Make KojiWrapper support krb_login with keytab

Using getattr so we also work with versions of koji that do not
read principal and keytab from the config file.

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2016-12-13 13:51:48 +00:00
parent c41c46403a
commit c0c3e2e79d
1 changed files with 3 additions and 1 deletions

View File

@ -55,7 +55,9 @@ class KojiWrapper(object):
os.path.expanduser(self.koji_module.config.ca),
os.path.expanduser(self.koji_module.config.serverca))
elif auth_type == 'kerberos':
self.koji_proxy.krb_login()
self.koji_proxy.krb_login(
getattr(self.koji_module.config, 'principal', None),
getattr(self.koji_module.config, 'keytab', None))
else:
raise RuntimeError('Unsupported authentication type in Koji')