diff --git a/ironic/drivers/modules/snmp.py b/ironic/drivers/modules/snmp.py index 8be3f908e5..340d34c1c7 100644 --- a/ironic/drivers/modules/snmp.py +++ b/ironic/drivers/modules/snmp.py @@ -75,15 +75,18 @@ REQUIRED_PROPERTIES = { 'snmp_outlet': _("PDU power outlet index (1-based). Required."), } OPTIONAL_PROPERTIES = { - 'snmp_version': _("SNMP protocol version: %(v1)s, %(v2c)s, %(v3)s " - "(optional, default %(v1)s)") - % {"v1": SNMP_V1, "v2c": SNMP_V2C, "v3": SNMP_V3}, - 'snmp_port': _("SNMP port, default %(port)d") % {"port": SNMP_PORT}, - 'snmp_community': _("SNMP community. Required for versions %(v1)s, " - "%(v2c)s") - % {"v1": SNMP_V1, "v2c": SNMP_V2C}, - 'snmp_security': _("SNMP security name. Required for version %(v3)s") - % {"v3": SNMP_V3}, + 'snmp_version': + _("SNMP protocol version: %(v1)s, %(v2c)s, %(v3)s " + "(optional, default %(v1)s)") + % {"v1": SNMP_V1, "v2c": SNMP_V2C, "v3": SNMP_V3}, + 'snmp_port': + _("SNMP port, default %(port)d") % {"port": SNMP_PORT}, + 'snmp_community': + _("SNMP community. Required for versions %(v1)s, %(v2c)s") + % {"v1": SNMP_V1, "v2c": SNMP_V2C}, + 'snmp_security': + _("SNMP security name. Required for version %(v3)s") + % {"v3": SNMP_V3}, } COMMON_PROPERTIES = REQUIRED_PROPERTIES.copy() COMMON_PROPERTIES.update(OPTIONAL_PROPERTIES) diff --git a/ironic/tests/drivers/test_ipmitool.py b/ironic/tests/drivers/test_ipmitool.py index c3573bbe55..4c6dad1fb8 100644 --- a/ironic/tests/drivers/test_ipmitool.py +++ b/ironic/tests/drivers/test_ipmitool.py @@ -1385,8 +1385,8 @@ class IPMIToolDriverTestCase(db_base.DbTestCase): 'Negative Hysteresis': '375.000', 'Sensor ID': 'FAN MOD 1A RPM (0x30)', 'Nominal Reading': '5325.000' - }, - 'FAN MOD 1B RPM (0x31)': { + }, + 'FAN MOD 1B RPM (0x31)': { 'Status': 'ok', 'Sensor Reading': '8550 (+/- 75) RPM', 'Entity ID': '7.1 (System Board)', @@ -1398,10 +1398,10 @@ class IPMIToolDriverTestCase(db_base.DbTestCase): 'Negative Hysteresis': '375.000', 'Sensor ID': 'FAN MOD 1B RPM (0x31)', 'Nominal Reading': '7800.000' - } - }, - 'Temperature': { - 'Temp (0x1)': { + } + }, + 'Temperature': { + 'Temp (0x1)': { 'Status': 'ok', 'Sensor Reading': '-58 (+/- 1) degrees C', 'Entity ID': '3.1 (Processor)', @@ -1414,8 +1414,8 @@ class IPMIToolDriverTestCase(db_base.DbTestCase): 'Upper critical': '90.000', 'Sensor ID': 'Temp (0x1)', 'Nominal Reading': '50.000' - }, - 'Temp (0x2)': { + }, + 'Temp (0x2)': { 'Status': 'ok', 'Sensor Reading': '50 (+/- 1) degrees C', 'Entity ID': '3.2 (Processor)', @@ -1428,9 +1428,9 @@ class IPMIToolDriverTestCase(db_base.DbTestCase): 'Upper critical': '90.000', 'Sensor ID': 'Temp (0x2)', 'Nominal Reading': '50.000' - } - } - } + } + } + } ret = ipmi._parse_ipmi_sensors_data(self.node, fake_sensors_data) self.assertEqual(expected_return, ret) @@ -1489,9 +1489,9 @@ class IPMIToolDriverTestCase(db_base.DbTestCase): 'Sensor ID': 'FAN MOD 1A RPM (0x30)', 'Nominal Reading': '5325.000' } - }, - 'Temperature': { - 'Temp (0x2)': { + }, + 'Temperature': { + 'Temp (0x2)': { 'Status': 'ok', 'Sensor Reading': '50 (+/- 1) degrees C', 'Entity ID': '3.2 (Processor)', @@ -1504,9 +1504,9 @@ class IPMIToolDriverTestCase(db_base.DbTestCase): 'Upper critical': '90.000', 'Sensor ID': 'Temp (0x2)', 'Nominal Reading': '50.000' - } - } - } + } + } + } ret = ipmi._parse_ipmi_sensors_data(self.node, fake_sensors_data) self.assertEqual(expected_return, ret) diff --git a/ironic/tests/drivers/test_pxe.py b/ironic/tests/drivers/test_pxe.py index 1cf2fde7ba..d5cfca2b3b 100644 --- a/ironic/tests/drivers/test_pxe.py +++ b/ironic/tests/drivers/test_pxe.py @@ -185,7 +185,7 @@ class PXEPrivateMethodsTestCase(db_base.DbTestCase): 'deployment_key': '0123456789ABCDEFGHIJKLMNOPQRSTUV', 'ari_path': ramdisk, 'iscsi_target_iqn': u'iqn-1be26c0b-03f2-4d2e-ae87-c02d7f33' - u'c123', + u'c123', 'deployment_ari_path': deploy_ramdisk, 'pxe_append_params': 'test_param', 'aki_path': kernel, diff --git a/tox.ini b/tox.ini index 4a3b6abf3c..9dcd30d067 100644 --- a/tox.ini +++ b/tox.ini @@ -47,7 +47,7 @@ commands = {posargs} [flake8] # E711: ignored because it is normal to use "column == None" in sqlalchemy # TODO(yuriyz): Analyze or fix the warnings blacklisted below -ignore = E12,E113,E131,E265,E711 +ignore = E12,E265,E711 exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,*ironic/nova* [hacking]