mirror of
				https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
				synced 2025-10-31 00:24:06 +00:00 
			
		
		
		
	fix traceback in useless i386 tests check
The recent change in commit ac6b0c1ba780913a5626b3e08e2c56f0d8454248 is not currently functional - it's hard to test and although similar functionality exists elsewhere in the code, the changes in said commit resulted in the following traceback: ``` 'str' object has no attribute 'architecture' ``` This commit amends the issue by utilising the `binaries_info` variable instead, with its properties defined here: https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu/tree/britney2/__init__.py#n304 Brian had previously made this commit: https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu/commit/?id=663bd2571cc81a9477408c0711aeb6b2452c17a8 to try and amend the issue, though it seems it hasn't helped. This commit also adds a little bit more logging surrounding this new functionality and also adds a break statement for efficiency.
This commit is contained in:
		
							parent
							
								
									663bd2571c
								
							
						
					
					
						commit
						a0dece5b76
					
				| @ -705,15 +705,19 @@ class AutopkgtestPolicy(BasePolicy): | |||||||
|         try: |         try: | ||||||
|             if arch == "i386": |             if arch == "i386": | ||||||
|                 all_binaries_arch_all = True |                 all_binaries_arch_all = True | ||||||
|                 srcinfo = source_suite.sources[src] |                 for package_name in binaries_info.keys(): | ||||||
|                 for pkg_id in srcinfo.binaries: |                     if binaries_info[package_name].architecture != "all": | ||||||
|                     if pkg_id.architecture != "all": |  | ||||||
|                         all_binaries_arch_all = False |                         all_binaries_arch_all = False | ||||||
|  |                         break | ||||||
|                 if all_binaries_arch_all: |                 if all_binaries_arch_all: | ||||||
|                     self.logger.info('Source package %s has binaries which are all Architecture: all, and tests have been requested on %s, not running any tests for this src package', |                     self.logger.info('Source package %s has binaries which are all Architecture: all, and tests have been requested on %s, not running any tests for this src package', | ||||||
|                                      src, |                                      src, | ||||||
|                                      arch) |                                      arch) | ||||||
|                     return [] |                     return [] | ||||||
|  |                 else: | ||||||
|  |                     self.logger.info('Source package %s has binaries which are NOT Architecture: all, and tests have been requested on %s, running tests for this package', | ||||||
|  |                                      src, | ||||||
|  |                                      arch) | ||||||
|         except Exception as e: |         except Exception as e: | ||||||
|             self.logger.error('i386 useless autopkgtest check failed with: %s', e) |             self.logger.error('i386 useless autopkgtest check failed with: %s', e) | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user