Merge "Use PortOpt for port options"

This commit is contained in:
Jenkins 2017-09-14 08:04:59 +00:00 committed by Gerrit Code Review
commit ff654bc33f
3 changed files with 6 additions and 5 deletions

View File

@ -118,10 +118,11 @@ def create_connection(conf, subsystem_path):
pem_path = conf.dogtag_plugin.pem_path
if pem_path is None:
raise ValueError(u._("pem_path is required"))
# port is string type in PKIConnection
connection = pki.client.PKIConnection(
'https',
conf.dogtag_plugin.dogtag_host,
conf.dogtag_plugin.dogtag_port,
str(conf.dogtag_plugin.dogtag_port),
subsystem_path)
connection.set_authentication_cert(pem_path)
return connection

View File

@ -30,9 +30,9 @@ dogtag_plugin_opts = [
cfg.StrOpt('dogtag_host',
default="localhost",
help=u._('Hostname for the Dogtag instance')),
cfg.StrOpt('dogtag_port',
default="8443",
help=u._('Port for the Dogtag instance')),
cfg.PortOpt('dogtag_port',
default=8443,
help=u._('Port for the Dogtag instance')),
cfg.StrOpt('nss_db_path',
help=u._('Path to the NSS certificate database')),
cfg.StrOpt('nss_password',

View File

@ -286,7 +286,7 @@ class WhenTestingDogtagCAPlugin(utils.BaseTestCase):
CONF.dogtag_plugin.ca_host_aid_path = self.host_ca_path
CONF.dogtag_plugin.auto_approved_profiles = [self.approved_profile_id]
CONF.dogtag_plugin.dogtag_host = "localhost"
CONF.dogtag_plugin.dogtag_port = "8443"
CONF.dogtag_plugin.dogtag_port = 8443
CONF.dogtag_plugin.simple_cmc_profile = "caOtherCert"
self.cfg = CONF