From f08fea68805564f22f3a2ba0372820bceed87559 Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Tue, 1 Sep 2015 20:04:53 +0100 Subject: [PATCH] register-nodes: add support for fake_pxe The fake_pxe driver in Ironic is a driver with a non-op power interface, so all the power actions needs to be performed manually. This updates the register-nodes command to support use of the fake_pxe driver with Ironic. The flake8 C901 was also added to the tox.ini to be ignored. This error is raised because we have too much if..elif conditions as part of the _extract_driver_info() function. It will need some refactoring later, so ignoring the error for now. Change-Id: I2de9643ddbdb73c5b49b7572cf476016d4911550 --- os_cloud_config/nodes.py | 4 ++++ tox.ini | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/os_cloud_config/nodes.py b/os_cloud_config/nodes.py index cc4fe29..8b9f79f 100644 --- a/os_cloud_config/nodes.py +++ b/os_cloud_config/nodes.py @@ -54,6 +54,10 @@ def _extract_driver_info(node): driver_info["iboot_relay_id"] = node["pm_relay_id"] if "pm_port" in node: driver_info["iboot_port"] = node["pm_port"] + elif node["pm_type"] == "fake_pxe": + # The fake_pxe driver doesn't need any credentials since there's + # no power management + pass else: raise ValueError("Unknown pm_type: %s" % node["pm_type"]) if "pxe" in node["pm_type"]: diff --git a/tox.ini b/tox.ini index 6da63ca..8ffb965 100644 --- a/tox.ini +++ b/tox.ini @@ -30,7 +30,7 @@ commands = python setup.py test --coverage --coverage-package-name='os_cloud_con # E123, E125 skipped as they are invalid PEP-8. show-source = True -ignore = E123,E125,H302,H803 +ignore = E123,E125,H302,H803,C901 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build max-complexity=14