diff options
author | Dmitry Tantsur <divius.inside@gmail.com> | 2018-06-25 15:07:18 +0200 |
---|---|---|
committer | Dmitry Tantsur <divius.inside@gmail.com> | 2018-06-26 14:30:11 +0200 |
commit | 6deb0c3b0b6f5ca1f71ce104597fda1d8560bc0d (patch) | |
tree | 4a0e36088482e3b4829e7ab2c1e7c88885f0c1a8 | |
parent | 575640cfacb06409fa9337d48924bcd846bee740 (diff) | |
download | ironic-6deb0c3b0b6f5ca1f71ce104597fda1d8560bc0d.tar.gz |
Remove the deprecated pxe_snmp driver
Change-Id: I3e9d102698cb09171c3ca3031098bc9f1d829a72
-rw-r--r-- | devstack/lib/ironic | 4 | ||||
-rw-r--r-- | ironic/drivers/pxe.py | 36 | ||||
-rw-r--r-- | ironic/tests/unit/drivers/test_pxe.py | 22 | ||||
-rw-r--r-- | releasenotes/notes/no-classic-snmp-b77d267b535da216.yaml | 5 | ||||
-rw-r--r-- | setup.cfg | 1 |
5 files changed, 7 insertions, 61 deletions
diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 43d33d94b..5d911c25d 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -289,7 +289,7 @@ if [[ "$IRONIC_DEPLOY_ISO_REQUIRED" = "True" \ or set IRONIC_BUILD_DEPLOY_RAMDISK=True to use ISOs" fi # Which deploy driver to use - valid choices right now -# are ``pxe_ipmitool``, ``agent_ipmitool``, ``pxe_snmp`` and ``ipmi``. +# are ``pxe_ipmitool``, ``agent_ipmitool``, ``snmp`` and ``ipmi``. # # Additional valid choices if IRONIC_IS_HARDWARE == true are: # ``cisco-ucs-managed``, ``cisco-ucs-standalone`` @@ -644,7 +644,7 @@ function is_deployed_by_drac { } function is_deployed_by_snmp { - [[ -z "${IRONIC_DEPLOY_DRIVER##*snmp}" ]] && return 0 + [[ "${IRONIC_DEPLOY_DRIVER}" == snmp ]] && return 0 return 1 } diff --git a/ironic/drivers/pxe.py b/ironic/drivers/pxe.py index 6e5bb230a..7a9d15909 100644 --- a/ironic/drivers/pxe.py +++ b/ironic/drivers/pxe.py @@ -30,8 +30,6 @@ from ironic.drivers.modules.irmc import inspect as irmc_inspect from ironic.drivers.modules.irmc import management as irmc_management from ironic.drivers.modules.irmc import power as irmc_power from ironic.drivers.modules import iscsi_deploy -from ironic.drivers.modules import pxe -from ironic.drivers.modules import snmp CONF = cfg.CONF @@ -42,40 +40,6 @@ PXEAndIPMIToolDriver = ipmi.PXEAndIPMIToolDriver PXEAndIPMIToolAndSocatDriver = ipmi.PXEAndIPMIToolAndSocatDriver -class PXEAndSNMPDriver(base.BaseDriver): - """PXE + SNMP driver. - - This driver implements the 'core' functionality, combining - :class:`ironic.drivers.snmp.SNMP` for power on/off and reboot with - :class:`ironic.drivers.modules.iscsi_deploy.ISCSIDeploy` for image - deployment. Implentations are in those respective classes; this - class is merely the glue between them. - """ - - def __init__(self): - # Driver has a runtime dependency on PySNMP, abort load if it is absent - if not importutils.try_import('pysnmp'): - raise exception.DriverLoadError( - driver=self.__class__.__name__, - reason=_("Unable to import pysnmp library")) - self.power = snmp.SNMPPower() - self.boot = pxe.PXEBoot() - self.deploy = iscsi_deploy.ISCSIDeploy() - - # PDUs have no boot device management capability. - # Only PXE as a boot device is supported. - self.management = None - - @classmethod - def to_hardware_type(cls): - return 'snmp', { - 'boot': 'pxe', - 'deploy': 'iscsi', - 'management': 'fake', - 'power': 'snmp', - } - - class PXEAndIRMCDriver(base.BaseDriver): """PXE + iRMC driver using SCCI. diff --git a/ironic/tests/unit/drivers/test_pxe.py b/ironic/tests/unit/drivers/test_pxe.py index 5a9a8a7a5..6c7bb8d0b 100644 --- a/ironic/tests/unit/drivers/test_pxe.py +++ b/ironic/tests/unit/drivers/test_pxe.py @@ -25,8 +25,6 @@ from ironic.drivers.modules.irmc import boot as irmc_boot from ironic.drivers.modules.irmc import management as irmc_management from ironic.drivers.modules.irmc import power as irmc_power from ironic.drivers.modules import iscsi_deploy -from ironic.drivers.modules import pxe as pxe_module -from ironic.drivers.modules import snmp from ironic.drivers import pxe @@ -34,26 +32,6 @@ class PXEDriversTestCase(testtools.TestCase): @mock.patch.object(pxe.importutils, 'try_import', spec_set=True, autospec=True) - def test_pxe_snmp_driver(self, try_import_mock): - try_import_mock.return_value = True - - driver = pxe.PXEAndSNMPDriver() - - self.assertIsInstance(driver.power, snmp.SNMPPower) - self.assertIsInstance(driver.boot, pxe_module.PXEBoot) - self.assertIsInstance(driver.deploy, iscsi_deploy.ISCSIDeploy) - self.assertIsNone(driver.management) - - @mock.patch.object(pxe.importutils, 'try_import', spec_set=True, - autospec=True) - def test_pxe_snmp_driver_import_error(self, try_import_mock): - try_import_mock.return_value = False - - self.assertRaises(exception.DriverLoadError, - pxe.PXEAndSNMPDriver) - - @mock.patch.object(pxe.importutils, 'try_import', spec_set=True, - autospec=True) def test_pxe_irmc_driver(self, try_import_mock): try_import_mock.return_value = True diff --git a/releasenotes/notes/no-classic-snmp-b77d267b535da216.yaml b/releasenotes/notes/no-classic-snmp-b77d267b535da216.yaml new file mode 100644 index 000000000..45189f95e --- /dev/null +++ b/releasenotes/notes/no-classic-snmp-b77d267b535da216.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + The deprecated ``pxe_snmp`` classic driver has been removed. Please use + the ``snmp`` hardware type instead. @@ -61,7 +61,6 @@ ironic.drivers = iscsi_pxe_oneview = ironic.drivers.oneview:ISCSIPXEOneViewDriver pxe_ipmitool = ironic.drivers.ipmi:PXEAndIPMIToolDriver pxe_ipmitool_socat = ironic.drivers.ipmi:PXEAndIPMIToolAndSocatDriver - pxe_snmp = ironic.drivers.pxe:PXEAndSNMPDriver pxe_irmc = ironic.drivers.pxe:PXEAndIRMCDriver ironic.hardware.interfaces.bios = |