osbs: Generate unique repo names
And include variant in repo file name. The whole path is unique already, but not the filename itself. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
		
							parent
							
								
									1759c1ba80
								
							
						
					
					
						commit
						d2849d3826
					
				| @ -142,12 +142,12 @@ class OSBSThread(WorkerThread): | |||||||
|         os_tree = compose.paths.compose.repository('$basearch', variant, |         os_tree = compose.paths.compose.repository('$basearch', variant, | ||||||
|                                                    create_dir=False) |                                                    create_dir=False) | ||||||
|         repo_file = os.path.join(compose.paths.work.tmp_dir(None, variant), |         repo_file = os.path.join(compose.paths.work.tmp_dir(None, variant), | ||||||
|                                  'compose-rpms-%s.repo' % self.num) |                                  'compose-rpms-%s-%s.repo' % (variant, self.num)) | ||||||
| 
 | 
 | ||||||
|         gpgcheck = 1 if gpgkey else 0 |         gpgcheck = 1 if gpgkey else 0 | ||||||
|         with open(repo_file, 'w') as f: |         with open(repo_file, 'w') as f: | ||||||
|             f.write('[%s]\n' % compose.compose_id) |             f.write('[%s-%s-%s]\n' % (compose.compose_id, variant, self.num)) | ||||||
|             f.write('name=Compose %s (RPMs)\n' % compose.compose_id) |             f.write('name=Compose %s (RPMs) - %s\n' % (compose.compose_id, variant)) | ||||||
|             f.write('baseurl=%s\n' % util.translate_path(compose, os_tree)) |             f.write('baseurl=%s\n' % util.translate_path(compose, os_tree)) | ||||||
|             f.write('enabled=1\n') |             f.write('enabled=1\n') | ||||||
|             f.write('gpgcheck=%s\n' % gpgcheck) |             f.write('gpgcheck=%s\n' % gpgcheck) | ||||||
|  | |||||||
| @ -206,7 +206,7 @@ class OSBSThreadTest(helpers.PungiTestCase): | |||||||
| 
 | 
 | ||||||
|     def _assertCorrectCalls(self, opts, setupCalls=None, scratch=False): |     def _assertCorrectCalls(self, opts, setupCalls=None, scratch=False): | ||||||
|         setupCalls = setupCalls or [] |         setupCalls = setupCalls or [] | ||||||
|         options = {'yum_repourls': ['http://root/work/global/tmp-Server/compose-rpms-1.repo']} |         options = {'yum_repourls': ['http://root/work/global/tmp-Server/compose-rpms-Server-1.repo']} | ||||||
|         if scratch: |         if scratch: | ||||||
|             options['scratch'] = True |             options['scratch'] = True | ||||||
|         options.update(opts) |         options.update(opts) | ||||||
| @ -229,7 +229,7 @@ class OSBSThreadTest(helpers.PungiTestCase): | |||||||
|     def _assertRepoFile(self, variants=None, gpgkey=None): |     def _assertRepoFile(self, variants=None, gpgkey=None): | ||||||
|         variants = variants or ['Server'] |         variants = variants or ['Server'] | ||||||
|         for variant in variants: |         for variant in variants: | ||||||
|             with open(self.topdir + '/work/global/tmp-%s/compose-rpms-1.repo' % variant) as f: |             with open(self.topdir + '/work/global/tmp-%s/compose-rpms-%s-1.repo' % (variant, variant)) as f: | ||||||
|                 lines = f.read().split('\n') |                 lines = f.read().split('\n') | ||||||
|                 self.assertIn('baseurl=http://root/compose/%s/$basearch/os' % variant, lines) |                 self.assertIn('baseurl=http://root/compose/%s/$basearch/os' % variant, lines) | ||||||
|                 if gpgkey: |                 if gpgkey: | ||||||
| @ -327,8 +327,8 @@ class OSBSThreadTest(helpers.PungiTestCase): | |||||||
|             'version': '1.0', |             'version': '1.0', | ||||||
|             'git_branch': 'f24-docker', |             'git_branch': 'f24-docker', | ||||||
|             'yum_repourls': [ |             'yum_repourls': [ | ||||||
|                 'http://root/work/global/tmp-Server/compose-rpms-1.repo', |                 'http://root/work/global/tmp-Server/compose-rpms-Server-1.repo', | ||||||
|                 'http://root/work/global/tmp-Everything/compose-rpms-1.repo', |                 'http://root/work/global/tmp-Everything/compose-rpms-Everything-1.repo', | ||||||
|                 'http://pkgs.example.com/my.repo', |                 'http://pkgs.example.com/my.repo', | ||||||
|             ] |             ] | ||||||
|         } |         } | ||||||
| @ -357,9 +357,9 @@ class OSBSThreadTest(helpers.PungiTestCase): | |||||||
|             'version': '1.0', |             'version': '1.0', | ||||||
|             'git_branch': 'f24-docker', |             'git_branch': 'f24-docker', | ||||||
|             'yum_repourls': [ |             'yum_repourls': [ | ||||||
|                 'http://root/work/global/tmp-Server/compose-rpms-1.repo', |                 'http://root/work/global/tmp-Server/compose-rpms-Server-1.repo', | ||||||
|                 'http://root/work/global/tmp-Everything/compose-rpms-1.repo', |                 'http://root/work/global/tmp-Everything/compose-rpms-Everything-1.repo', | ||||||
|                 'http://root/work/global/tmp-Client/compose-rpms-1.repo', |                 'http://root/work/global/tmp-Client/compose-rpms-Client-1.repo', | ||||||
|                 'http://pkgs.example.com/my.repo', |                 'http://pkgs.example.com/my.repo', | ||||||
|             ] |             ] | ||||||
|         } |         } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user