From 90c15e10cb9b532b41aaf7102a31d9d9e4beb85e Mon Sep 17 00:00:00 2001 From: Yosef Hoffman Date: Thu, 2 Jun 2016 10:57:31 -0400 Subject: [PATCH] lldp-timeout kernel parameter missing ipa- prefix Every other Ironic python agent kernel parameter is prefixed with "ipa-". This patch allows users to use the old "lldp-timeout" parameter or the new "ipa-lldp-timeout" parameter. Warning message is logged if "lldp-timeout" parameter is used. (Also fixed typo while I'm at it.) Change-Id: Icc05ead31506628e4926be6549916a19cad48db3 Closes-Bug: #1588325 --- ironic_python_agent/config.py | 5 +++-- ironic_python_agent/utils.py | 7 +++++++ .../notes/prefix-lldp-timeout-50acc656313d8dd2.yaml | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/prefix-lldp-timeout-50acc656313d8dd2.yaml diff --git a/ironic_python_agent/config.py b/ironic_python_agent/config.py index 482174a52..6c7db5d13 100644 --- a/ironic_python_agent/config.py +++ b/ironic_python_agent/config.py @@ -58,7 +58,7 @@ cli_opts = [ cfg.IntOpt('ip_lookup_sleep', default=int(APARAMS.get('ipa-ip-lookup-timeout', 10)), deprecated_name='ip-lookup-sleep', - help='The amaount of time to sleep between attempts' + help='The amount of time to sleep between attempts' 'to determine IP address.'), cfg.StrOpt('network_interface', @@ -88,7 +88,8 @@ cli_opts = [ help='The Ironic driver in use for this node'), cfg.FloatOpt('lldp_timeout', - default=APARAMS.get('lldp-timeout', 30.0), + default=APARAMS.get('ipa-lldp-timeout', + APARAMS.get('lldp-timeout', 30.0)), help='The amount of seconds to wait for LLDP packets.'), cfg.BoolOpt('standalone', diff --git a/ironic_python_agent/utils.py b/ironic_python_agent/utils.py index 87e8fac66..a5d0798b2 100644 --- a/ironic_python_agent/utils.py +++ b/ironic_python_agent/utils.py @@ -217,6 +217,13 @@ def get_agent_params(): # Cache the parameters so that it can be used later on. _set_cached_params(params) + # Check to see if any deprecated parameters have been used + deprecated_params = {'lldp-timeout': 'ipa-lldp-timeout'} + for old_param, new_param in deprecated_params.items(): + if params.get(old_param) is not None: + LOG.warning("The parameter '%s' has been deprecated. Please " + "use %s instead.", old_param, new_param) + return copy.deepcopy(params) diff --git a/releasenotes/notes/prefix-lldp-timeout-50acc656313d8dd2.yaml b/releasenotes/notes/prefix-lldp-timeout-50acc656313d8dd2.yaml new file mode 100644 index 000000000..44f0177c4 --- /dev/null +++ b/releasenotes/notes/prefix-lldp-timeout-50acc656313d8dd2.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - Every other Ironic python agent kernel parameter is prefixed with "ipa-". + This patch allows users to use the old "lldp-timeout" parameter or the + new "ipa-lldp-timeout" parameter.