Remove the deprecated pxe_snmp driver
Change-Id: I3e9d102698cb09171c3ca3031098bc9f1d829a72
This commit is contained in:
parent
575640cfac
commit
6deb0c3b0b
@ -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
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
||||
|
@ -25,33 +25,11 @@ 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
|
||||
|
||||
|
||||
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):
|
||||
|
5
releasenotes/notes/no-classic-snmp-b77d267b535da216.yaml
Normal file
5
releasenotes/notes/no-classic-snmp-b77d267b535da216.yaml
Normal file
@ -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 =
|
||||
|
Loading…
Reference in New Issue
Block a user