Merge "Add port type on port option"

This commit is contained in:
Jenkins 2015-08-27 10:57:53 +00:00 committed by Gerrit Code Review
commit 8719df3b99
4 changed files with 17 additions and 6 deletions

View File

@ -229,6 +229,8 @@
#
# The port for the Magnum API server. (integer value)
# Minimum value: 1
# Maximum value: 65535
#port = 9511
# The listen IP for the Magnum API server. (string value)
@ -703,6 +705,8 @@
#k8s_protocol = http
# Default port of the k8s master endpoint. (integer value)
# Minimum value: 1
# Maximum value: 65535
#k8s_port = 8080

View File

@ -16,12 +16,14 @@ import pecan
from magnum.api import auth
from magnum.api import config as api_config
from magnum.api import middleware
from magnum.common import config
# Register options for the service
API_SERVICE_OPTS = [
cfg.IntOpt('port',
default=9511,
help='The port for the Magnum API server.'),
cfg.Opt('port',
type=config.PORT_TYPE,
default=9511,
help='The port for the Magnum API server.'),
cfg.StrOpt('host',
default='127.0.0.1',
help='The listen IP for the Magnum API server.'),

View File

@ -16,10 +16,13 @@
# under the License.
from oslo_config import cfg
from oslo_config import types
from magnum.common import rpc
from magnum import version
PORT_TYPE = types.Integer(1, 65535)
def parse_args(argv, default_config_files=None):
rpc.set_defaults(control_exchange='magnum')

View File

@ -14,6 +14,7 @@
from oslo_config import cfg
from magnum.common import config
from magnum.common.pythonk8sclient.client import ApivbetaApi
from magnum.common.pythonk8sclient.client import swagger
from magnum.conductor import utils
@ -25,9 +26,10 @@ kubernetes_opts = [
default='http',
help=_('Default protocol of k8s master endpoint '
'(http or https).')),
cfg.IntOpt('k8s_port',
default=8080,
help=_('Default port of the k8s master endpoint.')),
cfg.Opt('k8s_port',
type=config.PORT_TYPE,
default=8080,
help=_('Default port of the k8s master endpoint.')),
]
cfg.CONF.register_opts(kubernetes_opts, group='kubernetes')