From 86934b81c5d7b78c5d9710cd88b9ca474ef680ee Mon Sep 17 00:00:00 2001 From: linggao Date: Mon, 9 Sep 2013 20:52:18 +0000 Subject: [PATCH] Rename ipmi driver to ipmitool To make naming more consistent with other ipmi drivers that will be introduced later, the module name for ipmi driver that uses the ipmitool is renamed from ipmi to ipmitool. Change-Id: I8ec0d4beb29a06af7b27d3ff0620fab5446579b1 --- etc/ironic/ironic.conf.sample | 2 +- ironic/db/api.py | 2 +- ironic/drivers/fake.py | 6 +++--- .../drivers/modules/{ipmi.py => ipmitool.py} | 0 ironic/drivers/pxe.py | 8 ++++---- .../drivers/{test_ipmi.py => test_ipmitool.py} | 18 +++++++++--------- setup.cfg | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) rename ironic/drivers/modules/{ipmi.py => ipmitool.py} (100%) rename ironic/tests/drivers/{test_ipmi.py => test_ipmitool.py} (96%) diff --git a/etc/ironic/ironic.conf.sample b/etc/ironic/ironic.conf.sample index a7b102c08d..91dd1c1ead 100644 --- a/etc/ironic/ironic.conf.sample +++ b/etc/ironic/ironic.conf.sample @@ -79,7 +79,7 @@ # -# Options defined in ironic.drivers.modules.ipmi +# Options defined in ironic.drivers.modules.ipmitool # # path to baremetal terminal program (string value) diff --git a/ironic/db/api.py b/ironic/db/api.py index 6c1e1a6f12..7561faef56 100644 --- a/ironic/db/api.py +++ b/ironic/db/api.py @@ -106,7 +106,7 @@ class Connection(object): 'instance_uuid': None, 'power_state': states.NOSTATE, 'provision_state': states.NOSTATE, - 'driver': 'pxe_ipmi', + 'driver': 'pxe_ipmitool', 'driver_info': { ... }, 'properties': { ... }, 'extra': { ... }, diff --git a/ironic/drivers/fake.py b/ironic/drivers/fake.py index 662da899b6..3479d2eb7f 100644 --- a/ironic/drivers/fake.py +++ b/ironic/drivers/fake.py @@ -20,7 +20,7 @@ Fake drivers used in testing. from ironic.drivers import base from ironic.drivers.modules import fake -from ironic.drivers.modules import ipmi +from ironic.drivers.modules import ipmitool from ironic.drivers.modules import pxe from ironic.drivers.modules import ssh @@ -34,11 +34,11 @@ class FakeDriver(base.BaseDriver): self.vendor = fake.FakeVendor() -class FakeIPMIDriver(base.BaseDriver): +class FakeIPMIToolDriver(base.BaseDriver): """Example implementation of a Driver.""" def __init__(self): - self.power = ipmi.IPMIPower() + self.power = ipmitool.IPMIPower() self.deploy = fake.FakeDeploy() self.vendor = self.power diff --git a/ironic/drivers/modules/ipmi.py b/ironic/drivers/modules/ipmitool.py similarity index 100% rename from ironic/drivers/modules/ipmi.py rename to ironic/drivers/modules/ipmitool.py diff --git a/ironic/drivers/pxe.py b/ironic/drivers/pxe.py index 834f1fd468..5b2b45a2d0 100644 --- a/ironic/drivers/pxe.py +++ b/ironic/drivers/pxe.py @@ -19,13 +19,13 @@ PXE Driver and supporting meta-classes. """ from ironic.drivers import base -from ironic.drivers.modules import ipmi +from ironic.drivers.modules import ipmitool from ironic.drivers.modules import pxe from ironic.drivers.modules import ssh -class PXEAndIPMIDriver(base.BaseDriver): - """PXE + IPMI driver. +class PXEAndIPMIToolDriver(base.BaseDriver): + """PXE + IPMITool driver. This driver implements the `core` functionality, combinding :class:ironic.drivers.ipmi.IPMI for power on/off and reboot with @@ -34,7 +34,7 @@ class PXEAndIPMIDriver(base.BaseDriver): """ def __init__(self): - self.power = ipmi.IPMIPower() + self.power = ipmitool.IPMIPower() self.deploy = pxe.PXEDeploy() self.rescue = self.deploy self.vendor = pxe.IPMIVendorPassthru() diff --git a/ironic/tests/drivers/test_ipmi.py b/ironic/tests/drivers/test_ipmitool.py similarity index 96% rename from ironic/tests/drivers/test_ipmi.py rename to ironic/tests/drivers/test_ipmitool.py index 8a0d3d0435..cb4b7531a7 100644 --- a/ironic/tests/drivers/test_ipmi.py +++ b/ironic/tests/drivers/test_ipmitool.py @@ -17,7 +17,7 @@ # License for the specific language governing permissions and limitations # under the License. -"""Test class for IPMI driver module.""" +"""Test class for IPMITool driver module.""" import os import stat @@ -31,7 +31,7 @@ from ironic.common import states from ironic.common import utils from ironic.conductor import task_manager from ironic.db import api as db_api -from ironic.drivers.modules import ipmi +from ironic.drivers.modules import ipmitool as ipmi from ironic.tests import base from ironic.tests.conductor import utils as mgr_utils from ironic.tests.db import base as db_base @@ -40,12 +40,12 @@ from ironic.tests.db import utils as db_utils CONF = cfg.CONF -class IPMIPrivateMethodTestCase(base.TestCase): +class IPMIToolPrivateMethodTestCase(base.TestCase): def setUp(self): - super(IPMIPrivateMethodTestCase, self).setUp() + super(IPMIToolPrivateMethodTestCase, self).setUp() self.node = db_utils.get_test_node( - driver='fake_ipmi', + driver='fake_ipmitool', driver_info=db_utils.ipmi_info) self.info = ipmi._parse_driver_info(self.node) @@ -152,15 +152,15 @@ class IPMIPrivateMethodTestCase(base.TestCase): self.assertEqual(state, states.ERROR) -class IPMIDriverTestCase(db_base.DbTestCase): +class IPMIToolDriverTestCase(db_base.DbTestCase): def setUp(self): - super(IPMIDriverTestCase, self).setUp() + super(IPMIToolDriverTestCase, self).setUp() self.dbapi = db_api.get_instance() - self.driver = mgr_utils.get_mocked_node_manager(driver='fake_ipmi') + self.driver = mgr_utils.get_mocked_node_manager(driver='fake_ipmitool') self.node = db_utils.get_test_node( - driver='fake_ipmi', + driver='fake_ipmitool', driver_info=db_utils.ipmi_info) self.info = ipmi._parse_driver_info(self.node) self.dbapi.create_node(self.node) diff --git a/setup.cfg b/setup.cfg index 0f9256c4af..268b7e5fdf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,10 +35,10 @@ console_scripts = ironic.drivers = fake = ironic.drivers.fake:FakeDriver - fake_ipmi = ironic.drivers.fake:FakeIPMIDriver + fake_ipmitool = ironic.drivers.fake:FakeIPMIToolDriver fake_ssh = ironic.drivers.fake:FakeSSHDriver fake_pxe = ironic.drivers.fake:FakePXEDriver - pxe_ipmi = ironic.drivers.pxe:PXEAndIPMIDriver + pxe_ipmitool = ironic.drivers.pxe:PXEAndIPMIToolDriver pxe_ssh = ironic.drivers.pxe:PXEAndSSHDriver [pbr]