From e60b1ba8bd3baeb395c6867522974a2e2ee4ebfe Mon Sep 17 00:00:00 2001 From: lingyongxu Date: Thu, 6 Apr 2017 11:07:44 +0800 Subject: [PATCH] Use HostAddressOpt for opts that accept IP and hostnames Some configuration options were accepting both IP addresses and hostnames. Since there was no specific OSLO opt type to support this, we were using ``StrOpt``. The change [1] that added support for ``HostAddressOpt`` type was merged in Ocata and became available for use with oslo version 3.22. This patch changes the opt type of configuration options to use this more relevant opt type - HostAddressOpt. [1] I77bdb64b7e6e56ce761d76696bc4448a9bd325eb Change-Id: I587ae3ee639bb7dc33f338a6ae224fa8e2b2d7fb --- tacker/common/config.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tacker/common/config.py b/tacker/common/config.py index 9dbe4f755..65572f37d 100644 --- a/tacker/common/config.py +++ b/tacker/common/config.py @@ -53,18 +53,19 @@ core_opts = [ cfg.BoolOpt('allow_sorting', default=False, help=_("Allow the usage of the sorting")), cfg.StrOpt('pagination_max_limit', default="-1", - help=_("The maximum number of items returned in a single " - "response, value was 'infinite' or negative integer " - "means no limit")), - cfg.StrOpt('host', default=utils.get_hostname(), - help=_("The hostname Tacker is running on")), + help=_("The maximum number of items returned " + "in a single response, value was 'infinite' " + "or negative integer means no limit")), + cfg.HostAddressOpt('host', default=utils.get_hostname(), + help=_("The hostname Tacker is running on")), ] core_cli_opts = [ cfg.StrOpt('state_path', default='/var/lib/tacker', help=_("Where to store Tacker state files. " - "This directory must be writable by the agent.")), + "This directory must be writable by " + "the agent.")), ] logging.register_options(cfg.CONF)