Trees | Indices | Help |
---|
|
1 # 2 # Copyright (c) 2008--2015 Red Hat, Inc. 3 # 4 # This software is licensed to you under the GNU General Public License, 5 # version 2 (GPLv2). There is NO WARRANTY for this software, express or 6 # implied, including the implied warranties of MERCHANTABILITY or FITNESS 7 # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 8 # along with this software; if not, see 9 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 10 # 11 # Red Hat trademarks are not licensed under GPLv2. No permission is 12 # granted to use or replicate Red Hat trademarks that are incorporated 13 # in this software or its documentation. 14 # 15 # 16 # Arch import process 17 # 18 19 from importLib import Import 20 21 29 3032 backend_method = 'processCPUArches'33 343648 4938 self.arch_types = {} 39 for item in self.batch: 40 arch_type_label = item['arch-type-label'] 41 arch_type_name = item['arch-type-name'] 42 self.arch_types[arch_type_label] = arch_type_name4345 self.backend.lookupArchTypes(self.arch_types) 46 for item in self.batch: 47 item['arch_type_id'] = self.arch_types[item['arch-type-label']]51 backend_method = 'processChannelArches'52 5355 backend_method = 'processPackageArches'56 5759 backend_method = 'processServerArches'60 6163 # Things that have to be overridden in subclasses 64 arches1_lookup_method_name = '' 65 arches2_lookup_method_name = '' 66 arches1_name = '' 67 arches2_name = '' 68 arches1_field_name = '' 69 arches2_field_name = '' 70 submit_method_name = '' 71 76106 10778 # Build the hashes keyed on the label 79 for entry in self.batch: 80 self.arches1[entry[self.arches1_name]] = None 81 self.arches2[entry[self.arches2_name]] = None8284 # Look up the arches 85 getattr(self.backend, self.arches1_lookup_method_name)(self.arches1) 86 getattr(self.backend, self.arches2_lookup_method_name)(self.arches2) 87 self._postprocess()8890 for entry in self.batch: 91 arch1_name = entry[self.arches1_name] 92 val = self.arches1.get(arch1_name) 93 if not val: 94 raise ValueError("Unsupported arch %s" % arch1_name) 95 entry[self.arches1_field_name] = val 96 97 arch2_name = entry[self.arches2_name] 98 val = self.arches2.get(arch2_name) 99 if not val: 100 raise ValueError("Unsupported arch %s" % arch2_name) 101 entry[self.arches2_field_name] = val102109 arches1_lookup_method_name = 'lookupServerArches' 110 arches2_lookup_method_name = 'lookupPackageArches' 111 arches1_name = 'server-arch' 112 arches2_name = 'package-arch' 113 arches1_field_name = 'server_arch_id' 114 arches2_field_name = 'package_arch_id' 115 submit_method_name = 'processServerPackageArchCompatMap'116 117119 arches1_lookup_method_name = 'lookupServerArches' 120 arches2_lookup_method_name = 'lookupChannelArches' 121 arches1_name = 'server-arch' 122 arches2_name = 'channel-arch' 123 arches1_field_name = 'server_arch_id' 124 arches2_field_name = 'channel_arch_id' 125 submit_method_name = 'processServerChannelArchCompatMap'126 127129 arches1_lookup_method_name = 'lookupChannelArches' 130 arches2_lookup_method_name = 'lookupPackageArches' 131 arches1_name = 'channel-arch' 132 arches2_name = 'package-arch' 133 arches1_field_name = 'channel_arch_id' 134 arches2_field_name = 'package_arch_id' 135 submit_method_name = 'processChannelPackageArchCompatMap'136 137139 arches1_lookup_method_name = 'lookupServerArches' 140 arches2_lookup_method_name = 'lookupServerGroupTypes' 141 arches1_name = 'server-arch' 142 arches2_name = 'server-group-type' 143 arches1_field_name = 'server_arch_id' 144 arches2_field_name = 'server_group_type' 145 submit_method_name = 'processServerGroupServerArchCompatMap' 146 147 # some entitlements are no longer supported, ignore any of them for 148 # backwards compatibility156150 self.batch[:] = [entry for entry in self.batch if 151 entry[self.arches2_name] not in [ 152 'monitoring_entitled', 'sw_mgr_entitled', 153 'provisioning_entitled', 'nonlinux_entitled', 154 'virtualization_host_platform']] 155 BaseArchCompatImport._postprocess(self)
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Mar 4 07:37:51 2020 | http://epydoc.sourceforge.net |