fix traceback in useless i386 tests check

The recent change in commit ac6b0c1ba7 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.
master
Tim Andersson 5 months ago
parent 663bd2571c
commit a0dece5b76
No known key found for this signature in database
GPG Key ID: 50AF67504D9E703D

@ -705,15 +705,19 @@ class AutopkgtestPolicy(BasePolicy):
try:
if arch == "i386":
all_binaries_arch_all = True
srcinfo = source_suite.sources[src]
for pkg_id in srcinfo.binaries:
if pkg_id.architecture != "all":
for package_name in binaries_info.keys():
if binaries_info[package_name].architecture != "all":
all_binaries_arch_all = False
break
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',
src,
arch)
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:
self.logger.error('i386 useless autopkgtest check failed with: %s', e)

Loading…
Cancel
Save