add krb_canon_host option to various clients

This commit is contained in:
Mike McLean 2017-10-24 15:50:32 -04:00
parent edda41100c
commit 900767cf4b
7 changed files with 18 additions and 7 deletions

View file

@ -5603,6 +5603,7 @@ def get_options():
'ccache': '/var/tmp/kojid.ccache',
'krbservice': 'host',
'krb_rdns': True,
'krb_canon_host': False,
'server': None,
'user': None,
'password': None,
@ -5640,7 +5641,7 @@ def get_options():
quit("value for %s option must be a valid integer" % name)
elif name in ['offline_retry', 'use_createrepo_c', 'createrepo_skip_stat',
'createrepo_update', 'keepalive', 'use_fast_upload',
'support_rpm_source_layout', 'krb_rdns',
'support_rpm_source_layout', 'krb_rdns', 'krb_canon_host',
'build_arch_can_fail', 'use_old_ssl', 'no_ssl_verify']:
defaults[name] = config.getboolean('kojid', name)
elif name in ['plugin', 'plugins']:

View file

@ -54,6 +54,8 @@ def get_options():
help=_("the service name of the principal being used by the hub"))
parser.add_option("--krb-rdns", action="store_true", default=False,
help=_("get reverse dns FQDN for krb target"))
parser.add_option("--krb-canon-host", action="store_true", default=False,
help=_("get canonical hostname for krb target"))
parser.add_option("--runas", metavar="USER",
help=_("run as the specified user (requires special privileges)"))
parser.add_option("--user", help=_("specify user"))
@ -134,6 +136,7 @@ def get_options():
['principal', None, 'string'],
['krbservice', None, 'string'],
['krb_rdns', None, 'boolean'],
['krb_canon_host', None, 'boolean'],
['runas', None, 'string'],
['user', None, 'string'],
['password', None, 'string'],

View file

@ -91,6 +91,8 @@ def get_options():
parser.add_option("--password", help=_("specify password"))
parser.add_option("--krb-rdns", action="store_true", default=False,
help=_("get reverse dns FQDN for krb target"))
parser.add_option("--krb-canon-host", action="store_true", default=False,
help=_("get canonical hostname for krb target"))
parser.add_option("--noauth", action="store_true", default=False,
help=_("do not authenticate"))
parser.add_option("-n", "--test", action="store_true", default=False,

View file

@ -739,6 +739,7 @@ def get_options():
'ccache': '/var/tmp/kojira.ccache',
'krbservice': 'host',
'krb_rdns': True,
'krb_canon_host': False,
'retry_interval': 60,
'max_retries': 120,
'offline_retry': True,
@ -766,7 +767,7 @@ def get_options():
str_opts = ('topdir', 'server', 'user', 'password', 'logfile', 'principal', 'keytab', 'krbservice',
'cert', 'ca', 'serverca', 'debuginfo_tags', 'source_tags') # FIXME: remove ca here
bool_opts = ('with_src','verbose','debug','ignore_stray_repos', 'offline_retry',
'krb_rdns', 'use_old_ssl', 'no_ssl_verify')
'krb_rdns', 'krb_canon_host', 'use_old_ssl', 'no_ssl_verify')
for name in config.options(section):
if name in int_opts:
defaults[name] = config.getint(section, name)

View file

@ -123,6 +123,7 @@ def get_options():
'ccache': '/var/tmp/kojivmd.ccache',
'krbservice': 'host',
'krb_rdns': True,
'krb_canon_host': False,
'server': None,
'user': None,
'password': None,
@ -145,8 +146,8 @@ def get_options():
defaults[name] = int(value)
except ValueError:
quit("value for %s option must be a valid integer" % name)
elif name in ['offline_retry', 'krb_rdns', 'use_old_ssl',
'no_ssl_verify']:
elif name in ['offline_retry', 'krb_rdns', 'krb_canon_host',
'use_old_ssl', 'no_ssl_verify']:
defaults[name] = config.getboolean('kojivmd', name)
elif name in ['plugin', 'plugins']:
defaults['plugin'] = value.split()

View file

@ -158,9 +158,11 @@ def _assertLogin(environ):
def _getServer(environ):
opts = environ['koji.options']
session = koji.ClientSession(opts['KojiHubURL'],
opts={'krbservice': opts['KrbService'],
'krb_rdns': opts['KrbRDNS']})
s_opts = {'krbservice': opts['KrbService'],
'krb_rdns': opts['KrbRDNS'],
'krb_canon_host': opts['KrbCanonHost'],
}
session = koji.ClientSession(opts['KojiHubURL'], opts=s_opts)
environ['koji.currentLogin'] = _getUserCookie(environ)
if environ['koji.currentLogin']:

View file

@ -76,6 +76,7 @@ class Dispatcher(object):
['WebCCache', 'string', '/var/tmp/kojiweb.ccache'],
['KrbService', 'string', 'host'],
['KrbRDNS', 'boolean', True],
['KrbCanonHost', 'boolean', False],
['WebCert', 'string', None],
['KojiHubCA', 'string', '/etc/kojiweb/kojihubca.crt'],