diff options
author | Zuul <zuul@review.opendev.org> | 2020-05-13 17:04:57 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-05-13 17:04:57 +0000 |
commit | f1b2cb74545b4ea75bd551fca61c69f53bb608fd (patch) | |
tree | 7d9af3ffd1614c07bb42e4210b062daf901d44b8 | |
parent | cb4fda03bda78aae8df019facbc40c3397d93594 (diff) | |
parent | d1aa76d0c18c4af6cbf78bd68ff41d23b368a8a0 (diff) | |
download | ironic-f1b2cb74545b4ea75bd551fca61c69f53bb608fd.tar.gz |
Merge "Move ipmi logging to a separate option" into stable/stein12.1.5
-rw-r--r-- | ironic/conf/ipmi.py | 6 | ||||
-rw-r--r-- | ironic/drivers/modules/ipmitool.py | 2 | ||||
-rw-r--r-- | ironic/tests/unit/drivers/modules/test_ipmitool.py | 9 | ||||
-rw-r--r-- | releasenotes/notes/ipmi-debug-1c7e090c6cc71903.yaml | 13 |
4 files changed, 25 insertions, 5 deletions
diff --git a/ironic/conf/ipmi.py b/ironic/conf/ipmi.py index 466888e35..49dfda91c 100644 --- a/ironic/conf/ipmi.py +++ b/ironic/conf/ipmi.py @@ -49,6 +49,12 @@ opts = [ 'that command, the default value is True. It may be ' 'overridden by per-node \'ipmi_disable_boot_timeout\' ' 'option in node\'s \'driver_info\' field.')), + cfg.BoolOpt('debug', + default=False, + help=_('Enables all ipmi commands to be executed with an ' + 'additional debugging output. This is a separate ' + 'option as ipmitool can log a substantial amount ' + 'of misleading text when in this mode.')), ] diff --git a/ironic/drivers/modules/ipmitool.py b/ironic/drivers/modules/ipmitool.py index bb37b44c8..1d285e18b 100644 --- a/ironic/drivers/modules/ipmitool.py +++ b/ironic/drivers/modules/ipmitool.py @@ -445,7 +445,7 @@ def _get_ipmitool_args(driver_info, pw_file=None): args.append('-f') args.append(pw_file) - if CONF.debug: + if CONF.ipmi.debug: args.append('-v') # ensure all arguments are strings diff --git a/ironic/tests/unit/drivers/modules/test_ipmitool.py b/ironic/tests/unit/drivers/modules/test_ipmitool.py index 8aa3c3a2c..efea67721 100644 --- a/ironic/tests/unit/drivers/modules/test_ipmitool.py +++ b/ironic/tests/unit/drivers/modules/test_ipmitool.py @@ -454,6 +454,7 @@ class Base(db_base.DbTestCase): enabled_console_interfaces=['fake', 'ipmitool-socat', 'ipmitool-shellinabox', 'no-console']) + self.config(debug=True, group="ipmi") self.node = obj_utils.create_test_node( self.context, console_interface='ipmitool-socat', @@ -2569,7 +2570,7 @@ class IPMIToolShellinaboxTestCase(db_base.DbTestCase): ipmi_cmd = self.console._get_ipmi_cmd(driver_info, 'pw_file') expected_ipmi_cmd = ("/:%(uid)s:%(gid)s:HOME:ipmitool " "-I lanplus -H %(address)s -L ADMINISTRATOR " - "-U %(user)s -f pw_file -v" % + "-U %(user)s -f pw_file" % {'uid': os.getuid(), 'gid': os.getgid(), 'address': driver_info['address'], 'user': driver_info['username']}) @@ -2583,7 +2584,7 @@ class IPMIToolShellinaboxTestCase(db_base.DbTestCase): ipmi_cmd = self.console._get_ipmi_cmd(driver_info, 'pw_file') expected_ipmi_cmd = ("/:%(uid)s:%(gid)s:HOME:ipmitool " "-I lanplus -H %(address)s -L ADMINISTRATOR " - "-f pw_file -v" % + "-f pw_file" % {'uid': os.getuid(), 'gid': os.getgid(), 'address': driver_info['address']}) self.assertEqual(expected_ipmi_cmd, ipmi_cmd) @@ -2717,7 +2718,7 @@ class IPMIToolSocatDriverTestCase(IPMIToolShellinaboxTestCase): ipmi_cmd = self.console._get_ipmi_cmd(driver_info, 'pw_file') expected_ipmi_cmd = ("ipmitool -I lanplus -H %(address)s " "-L ADMINISTRATOR -U %(user)s " - "-f pw_file -v" % + "-f pw_file" % {'address': driver_info['address'], 'user': driver_info['username']}) self.assertEqual(expected_ipmi_cmd, ipmi_cmd) @@ -2730,7 +2731,7 @@ class IPMIToolSocatDriverTestCase(IPMIToolShellinaboxTestCase): ipmi_cmd = self.console._get_ipmi_cmd(driver_info, 'pw_file') expected_ipmi_cmd = ("ipmitool -I lanplus -H %(address)s " "-L ADMINISTRATOR " - "-f pw_file -v" % + "-f pw_file" % {'address': driver_info['address']}) self.assertEqual(expected_ipmi_cmd, ipmi_cmd) diff --git a/releasenotes/notes/ipmi-debug-1c7e090c6cc71903.yaml b/releasenotes/notes/ipmi-debug-1c7e090c6cc71903.yaml new file mode 100644 index 000000000..d0feb47f4 --- /dev/null +++ b/releasenotes/notes/ipmi-debug-1c7e090c6cc71903.yaml @@ -0,0 +1,13 @@ +--- +features: + - | + Adds a new ``[ipmi]debug`` option that allows users to explicitly turn + IPMI command debugging on, as opposed to relying upon the system debug + setting ``[DEFAULT]debug``. Users wishing to continue to log this output + should set ``[ipmi]debug`` to ``True`` in their ironic.conf. +upgrade: + - Debug logging control has been moved to the ``[ipmi]debug`` configuration + setting as opposed to the "conductor" ``[DEFAULT]debug`` setting as + the existing ``ipmitool`` output can be extremely misleading for users. + Operators who wish to continue to log ``ipmitool`` verbose output in their + logs should explicitly set the ``[ipmi]debug`` command to True. |