p/autopkgtest: fix v3 swift auth configuration check

In swift v3, the tenant is replaced by the project, so better update the
check accordingly.
This fixes a stacktrace in production happening because the
`ADT_SWIFT_TENANT` config had been dropped for some reasons.

Stacktrace:
```
Traceback (most recent call last):
  File "/var/lib/security-britney/britney2-ubuntu/britney.py", line 1623, in <module>
    Britney().main()
  File "/var/lib/security-britney/britney2-ubuntu/britney.py", line 400, in __init__
    self._policy_engine.initialise(self, self.hints)
  File "/var/lib/security-britney/britney2-ubuntu/britney2/policies/policy.py", line 35, in initialise
    policy.initialise(britney)
  File "/var/lib/security-britney/britney2-ubuntu/britney2/policies/autopkgtest.py", line 256, in initialise
    not self.options.adt_swift_tenant or
AttributeError: 'Values' object has no attribute 'adt_swift_tenant'
```
sil2100/security-britney
Florent 'Skia' Jacquet 10 months ago
parent 761942c917
commit 1fa5922d66

@ -253,7 +253,7 @@ class AutopkgtestPolicy(BasePolicy):
if self.options.adt_swift_user: if self.options.adt_swift_user:
if (not self.options.adt_swift_pass or if (not self.options.adt_swift_pass or
not self.options.adt_swift_auth_url or not self.options.adt_swift_auth_url or
not self.options.adt_swift_tenant or not self.options.adt_swift_project or
not self.options.adt_swift_region): not self.options.adt_swift_region):
raise RuntimeError('Incomplete swift credentials given') raise RuntimeError('Incomplete swift credentials given')

Loading…
Cancel
Save