diff --git a/osclib/freeze_command.py b/osclib/freeze_command.py index 474a81250..7e5b83acf 100644 --- a/osclib/freeze_command.py +++ b/osclib/freeze_command.py @@ -154,6 +154,12 @@ def prj_meta_for_bootstrap_copy(self): for lprj in links: ET.SubElement(root, 'link', {'project': lprj}) + # 'images' and 'product' repositories are closely related, + # and they need to be handled the same way. + image_repositories = ['images'] + if self.api.project_has_repo('product', self.prj): + image_repositories.append('product') + # build flag f = ET.SubElement(root, 'build') # this one is the global toggle @@ -161,12 +167,14 @@ def prj_meta_for_bootstrap_copy(self): # this one stays ET.SubElement(f, 'disable', {'repository': 'bootstrap_copy'}) # to be flipped by botmaster - ET.SubElement(f, 'disable', {'repository': 'images'}) + for repository in image_repositories: + ET.SubElement(f, 'disable', {'repository': repository}) # publish flag f = ET.SubElement(root, 'publish') ET.SubElement(f, 'disable') - ET.SubElement(f, 'enable', {'repository': 'images'}) + for repository in image_repositories: + ET.SubElement(f, 'enable', {'repository': repository}) # debuginfo flag f = ET.SubElement(root, 'debuginfo') @@ -184,18 +192,20 @@ def prj_meta_for_bootstrap_copy(self): a = ET.SubElement(r, 'arch') a.text = arch - r = ET.SubElement(root, 'repository', {'name': 'images', 'linkedbuild': 'all'}) - ET.SubElement(r, 'path', {'project': self.prj, 'repository': 'standard'}) + for repository in image_repositories: + r = ET.SubElement(root, 'repository', {'name': repository, 'linkedbuild': 'all'}) + ET.SubElement(r, 'path', {'project': self.prj, 'repository': 'standard'}) - if self.prj.startswith('SUSE:'): - a = ET.SubElement(r, 'arch') - a.text = 'local' - a = ET.SubElement(r, 'arch') - a.text = 'x86_64' + if self.prj.startswith('SUSE:'): + a = ET.SubElement(r, 'arch') + a.text = 'local' - if 'ppc64le' in self.api.cstaging_archs: a = ET.SubElement(r, 'arch') - a.text = 'ppc64le' + a.text = 'x86_64' + + if 'ppc64le' in self.api.cstaging_archs: + a = ET.SubElement(r, 'arch') + a.text = 'ppc64le' return ET.tostring(root) diff --git a/osclib/stagingapi.py b/osclib/stagingapi.py index 1a0c02b4b..9b52cd867 100644 --- a/osclib/stagingapi.py +++ b/osclib/stagingapi.py @@ -144,9 +144,9 @@ def is_staging_manager(self): self._is_staging_manager = self.is_user_member_of(self.user, self.cstaging_group) return self._is_staging_manager - def project_has_repo(self, repo_name): + def project_has_repo(self, repo_name, project=None): # Determine if the project has a repo with given name - meta = self.get_prj_meta(self.project) + meta = self.get_prj_meta(project or self.project) xpath = f'repository[@name="{repo_name}"]' return len(meta.xpath(xpath)) > 0