From 7cbb03074d982460d8265fb1e6f3598305678fa1 Mon Sep 17 00:00:00 2001 From: Pavlo Shchelokovskyy Date: Thu, 31 Aug 2017 11:22:14 +0000 Subject: [PATCH] Deprecate classic drivers this patch deprecates classic drivers defined by ironic_staging_drivers package in favor of hardware types. A proper warning is shown on classic drivers init. DevStack plugin no longer enables any classic driver from staging drivers, and only hardware types are tested. Change-Id: Ic53b71c94287804f3c66f5e9a6249f605c234211 --- devstack/plugin.sh | 9 --------- ironic_staging_drivers/amt/drivers.py | 12 +++++++++++ ironic_staging_drivers/ansible/__init__.py | 9 +++++++++ ironic_staging_drivers/iboot/__init__.py | 9 +++++++++ ironic_staging_drivers/intel_nm/__init__.py | 6 ++++++ ironic_staging_drivers/libvirt/__init__.py | 9 +++++++++ ironic_staging_drivers/wol/__init__.py | 9 +++++++++ ...cate-classic-drivers-7f8bacac9cb3fba2.yaml | 20 +++++++++++++++++++ 8 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/deprecate-classic-drivers-7f8bacac9cb3fba2.yaml diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 5273714..7ce1b22 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -46,17 +46,8 @@ function update_ironic_enabled_drivers { # NOTE(vsaienko) if ironic-staging-drivers are called after ironic # setting IRONIC_ENABLED_* will not take affect. Update ironic # configuration explicitly for each option. - local staging_drivers local staging_hw_types - staging_drivers=$($IRONIC_STAGING_LIST_EP_CMD -t ironic.drivers) - if [[ -z "$IRONIC_ENABLED_DRIVERS" ]]; then - IRONIC_ENABLED_DRIVERS="$staging_drivers" - else - IRONIC_ENABLED_DRIVERS+=",$staging_drivers" - fi - iniset $IRONIC_CONF_FILE DEFAULT enabled_drivers "$IRONIC_ENABLED_DRIVERS" - # hardware types staging_hw_types=$($IRONIC_STAGING_LIST_EP_CMD -t ironic.hardware.types) if [[ -z "$IRONIC_ENABLED_HARDWARE_TYPES" ]]; then diff --git a/ironic_staging_drivers/amt/drivers.py b/ironic_staging_drivers/amt/drivers.py index 57e3202..4e8e27f 100644 --- a/ironic_staging_drivers/amt/drivers.py +++ b/ironic_staging_drivers/amt/drivers.py @@ -19,13 +19,17 @@ from ironic.drivers import generic from ironic.drivers.modules import agent from ironic.drivers.modules import fake from ironic.drivers.modules import pxe +from oslo_log import log as logging from oslo_utils import importutils + from ironic_staging_drivers.amt import deploy as amt_deploy from ironic_staging_drivers.amt import management as amt_management from ironic_staging_drivers.amt import power as amt_power from ironic_staging_drivers.common.i18n import _ +LOG = logging.getLogger(__name__) + # NOTE(lintan) There is a strange behavior for tox if put below classes # in __init__.py. It will reload pywsman and set it to None. So place @@ -50,7 +54,11 @@ class PXEAndAMTISCSIDriver(base.BaseDriver): deployment. Implementations are in those respective classes; this class is merely the glue between them. """ + def __init__(self): + LOG.warning("This driver is deprecated and will be removed " + "in the Rocky release. " + "Use 'staging-amt' hardware type instead.") if not importutils.try_import('pywsman'): raise ironic_exception.DriverLoadError( driver=self.__class__.__name__, @@ -71,7 +79,11 @@ class PXEAndAMTAgentDriver(base.BaseDriver): deployment. Implementations are in those respective classes; this class is merely the glue between them. """ + def __init__(self): + LOG.warning("This driver is deprecated and will be removed " + "in the Rocky release. " + "Use 'staging-amt' hardware type instead.") if not importutils.try_import('pywsman'): raise ironic_exception.DriverLoadError( driver=self.__class__.__name__, diff --git a/ironic_staging_drivers/ansible/__init__.py b/ironic_staging_drivers/ansible/__init__.py index 6284869..46d58eb 100644 --- a/ironic_staging_drivers/ansible/__init__.py +++ b/ironic_staging_drivers/ansible/__init__.py @@ -15,15 +15,21 @@ from ironic.drivers import ipmi from ironic.drivers.modules import fake from ironic.drivers.modules import ipmitool from ironic.drivers.modules import pxe +from oslo_log import log as logging from ironic_staging_drivers.ansible import deploy as ansible_deploy from ironic_staging_drivers.libvirt import power as libvirt_power +LOG = logging.getLogger(__name__) + class AnsibleAndIPMIToolDriver(base.BaseDriver): """Ansible + Ipmitool driver.""" def __init__(self): + LOG.warning("This driver is deprecated and will be removed " + "in the Rocky release. " + "Use 'staging-ansible-ipmi' hardware type instead.") self.power = ipmitool.IPMIPower() self.boot = pxe.PXEBoot() self.deploy = ansible_deploy.AnsibleDeploy() @@ -48,6 +54,9 @@ class AnsibleAndLibvirtDriver(base.BaseDriver): """ def __init__(self): + LOG.warning("This driver is deprecated and will be removed " + "in the Rocky release. " + "Use 'staging-libvirt' hardware type instead.") self.power = libvirt_power.LibvirtPower() self.boot = pxe.PXEBoot() self.deploy = ansible_deploy.AnsibleDeploy() diff --git a/ironic_staging_drivers/iboot/__init__.py b/ironic_staging_drivers/iboot/__init__.py index 1d9641d..18e7ce8 100644 --- a/ironic_staging_drivers/iboot/__init__.py +++ b/ironic_staging_drivers/iboot/__init__.py @@ -22,10 +22,13 @@ from ironic.drivers.modules import agent from ironic.drivers.modules import fake from ironic.drivers.modules import iscsi_deploy from ironic.drivers.modules import pxe +from oslo_log import log as logging from oslo_utils import importutils from ironic_staging_drivers.iboot import power as iboot_power +LOG = logging.getLogger(__name__) + class FakeIBootFakeDriver(base.BaseDriver): """Fake iBoot driver.""" @@ -51,6 +54,9 @@ class PXEIBootISCSIDriver(base.BaseDriver): this class is merely the glue between them. """ def __init__(self): + LOG.warning("This driver is deprecated and will be removed " + "in the Rocky release. " + "Use 'staging-iboot' hardware type instead.") if not importutils.try_import('iboot'): raise ironic_exception.DriverLoadError( driver=self.__class__.__name__, @@ -71,6 +77,9 @@ class PXEIBootAgentDriver(base.BaseDriver): this class is merely the glue between them. """ def __init__(self): + LOG.warning("This driver is deprecated and will be removed " + "in the Rocky release. " + "Use 'staging-iboot' hardware type instead.") if not importutils.try_import('iboot'): raise ironic_exception.DriverLoadError( driver=self.__class__.__name__, diff --git a/ironic_staging_drivers/intel_nm/__init__.py b/ironic_staging_drivers/intel_nm/__init__.py index 8259f37..e64ebd2 100644 --- a/ironic_staging_drivers/intel_nm/__init__.py +++ b/ironic_staging_drivers/intel_nm/__init__.py @@ -18,9 +18,12 @@ from ironic.drivers.modules import inspector from ironic.drivers.modules import ipmitool from ironic.drivers.modules import pxe from ironic.drivers import utils +from oslo_log import log as logging from ironic_staging_drivers.intel_nm import nm_vendor +LOG = logging.getLogger(__name__) + class FakeIntelNMDriver(base.BaseDriver): """Fake Intel NM driver.""" @@ -34,6 +37,9 @@ class FakeIntelNMDriver(base.BaseDriver): class AgentAndIPMIToolIntelNMDriver(base.BaseDriver): """Agent + IPMITool driver with Intel NM policies.""" def __init__(self): + LOG.warning("This driver is deprecated and will be removed " + "in the Rocky release. " + "Use 'staging-nm' hardware type instead.") self.power = ipmitool.IPMIPower() self.boot = pxe.PXEBoot() self.deploy = agent.AgentDeploy() diff --git a/ironic_staging_drivers/libvirt/__init__.py b/ironic_staging_drivers/libvirt/__init__.py index 5526231..b1d1ab5 100644 --- a/ironic_staging_drivers/libvirt/__init__.py +++ b/ironic_staging_drivers/libvirt/__init__.py @@ -16,10 +16,13 @@ from ironic.drivers.modules import agent from ironic.drivers.modules import fake from ironic.drivers.modules import iscsi_deploy from ironic.drivers.modules import pxe +from oslo_log import log as logging from ironic_staging_drivers.ansible import deploy as ansible_deploy from ironic_staging_drivers.libvirt import power +LOG = logging.getLogger(__name__) + class FakeLibvirtFakeDriver(base.BaseDriver): """Example implementation of a Driver.""" @@ -44,6 +47,9 @@ class PXELibvirtAgentDriver(base.BaseDriver): """ def __init__(self): + LOG.warning("This driver is deprecated and will be removed " + "in the Rocky release. " + "Use 'staging-libvirt' hardware type instead.") self.power = power.LibvirtPower() self.boot = pxe.PXEBoot() self.deploy = agent.AgentDeploy() @@ -63,6 +69,9 @@ class PXELibvirtISCSIDriver(base.BaseDriver): """ def __init__(self): + LOG.warning("This driver is deprecated and will be removed " + "in the Rocky release. " + "Use 'staging-libvirt' hardware type instead.") self.power = power.LibvirtPower() self.boot = pxe.PXEBoot() self.deploy = iscsi_deploy.ISCSIDeploy() diff --git a/ironic_staging_drivers/wol/__init__.py b/ironic_staging_drivers/wol/__init__.py index 111d67b..ae770dc 100644 --- a/ironic_staging_drivers/wol/__init__.py +++ b/ironic_staging_drivers/wol/__init__.py @@ -19,9 +19,12 @@ from ironic.drivers.modules import agent from ironic.drivers.modules import fake from ironic.drivers.modules import iscsi_deploy from ironic.drivers.modules import pxe +from oslo_log import log as logging from ironic_staging_drivers.wol import power as wol_power +LOG = logging.getLogger(__name__) + class FakeWakeOnLanFakeDriver(base.BaseDriver): """Fake Wake-On-Lan driver.""" @@ -44,6 +47,9 @@ class PXEWakeOnLanISCSIDriver(base.BaseDriver): """ def __init__(self): + LOG.warning("This driver is deprecated and will be removed " + "in the Rocky release. " + "Use 'staging-wol' hardware type instead.") self.boot = pxe.PXEBoot() self.power = wol_power.WakeOnLanPower() self.deploy = iscsi_deploy.ISCSIDeploy() @@ -61,6 +67,9 @@ class PXEWakeOnLanAgentDriver(base.BaseDriver): """ def __init__(self): + LOG.warning("This driver is deprecated and will be removed " + "in the Rocky release. " + "Use 'staging-wol' hardware type instead.") self.boot = pxe.PXEBoot() self.power = wol_power.WakeOnLanPower() self.deploy = agent.AgentDeploy() diff --git a/releasenotes/notes/deprecate-classic-drivers-7f8bacac9cb3fba2.yaml b/releasenotes/notes/deprecate-classic-drivers-7f8bacac9cb3fba2.yaml new file mode 100644 index 0000000..3b9781d --- /dev/null +++ b/releasenotes/notes/deprecate-classic-drivers-7f8bacac9cb3fba2.yaml @@ -0,0 +1,20 @@ +--- +deprecations: + - | + Classic ironic drivers defined by ``ironic-staging-drivers`` package + are deprecated and will be removed in the Rocky release. + Operators are suggested to use new, dynamic ironic drivers (hardware types) + instead:: + + - ``pxe_amt_iscsi`` -> ``staging-amt`` hw type with ``staging-amt`` deploy interface + - ``pxe_amt_agent`` -> ``staging-amt`` hw type with ``direct`` deploy interface + - ``pxe_ipmitool_ansible`` -> ``staging-ansible-ipmi`` hw type with ``staging-ansible`` deploy interface + - ``pxe_libvirt_ansible`` -> ``staging-libvirt`` hw type with ``staging-ansible`` deploy interface + - ``pxe_iboot_agent`` -> ``staging-iboot`` hw type with ``direct`` deploy interface + - ``pxe_iboot_iscsi`` -> ``staging-iboot`` hw type with ``iscsi`` deploy interface + - ``agent_ipmitool_nm`` -> ``staging-nm`` hw type with ``staging-nm`` vendor interface + - ``pxe_libvirt_agent`` -> ``staging-libvirt`` hw type with ``direct`` deploy interface + - ``pxe_libvirt_iscsi`` -> ``staging-libvirt`` hw type with ``iscsi`` deploy interface + - ``pxe_wol_iscsi`` -> ``staging-wol`` hw type with ``iscsi`` deploy interface + - ``pxe_wol_agent`` -> ``staging-wol`` hw type with ``direct`` deploy interface +