Revert "Remove python-oneviewclient from Ironic OneView drivers"

Reverting these changes because python-hpOneView does not provide HTTPS
secure connection with custom CAcert and could cause a possible security issue.

This reverts commit 037360f64d5db7401df1d656fa8f1932011b5587.

Change-Id: I2a95f3cd23f20c363fe97fc347c9d2619d2ab5e9
This commit is contained in:
Hugo Nicodemos 2017-11-09 18:07:01 +00:00
parent 9982a881e6
commit 9b523967e1
17 changed files with 159 additions and 30 deletions

View File

@ -24,8 +24,9 @@ Classic Drivers
=============== ===============
The ``iscsi_pxe_oneview`` and ``agent_pxe_oneview`` drivers implement the The ``iscsi_pxe_oneview`` and ``agent_pxe_oneview`` drivers implement the
core interfaces of an ironic Driver [2]_, and use the ``hpOneView`` [3]_ to core interfaces of an ironic Driver [2]_, and use the ``python-oneviewclient``
provide communication between ironic and OneView through OneView's REST API. [3]_ to provide communication between ironic and OneView through OneView's
REST API.
.. note:: .. note::
Classic drivers will be deprecated in favor of Hardware Types. Classic drivers will be deprecated in favor of Hardware Types.
@ -38,15 +39,15 @@ process:
* The ironic driver for OneView, which can be: * The ironic driver for OneView, which can be:
* `iscsi_pxe_oneview` or * `iscsi_pxe_oneview` or
* `agent_pxe_oneview` * `agent_pxe_oneview`
* The hpOneView library * The python-oneviewclient library
* The OneView appliance * The OneView appliance
The role of ironic is to serve as a bare metal provider to OneView's managed The role of ironic is to serve as a bare metal provider to OneView's managed
physical hardware and to provide communication with other necessary OpenStack physical hardware and to provide communication with other necessary OpenStack
services such as Nova and Glance. When ironic receives a boot request, it services such as Nova and Glance. When ironic receives a boot request, it
works together with the ironic OneView driver to access a machine in OneView, works together with the ironic OneView driver to access a machine in OneView,
the ``hpOneView`` being responsible for the communication with the OneView the ``python-oneviewclient`` being responsible for the communication with the
appliance. OneView appliance.
From the Newton release on, OneView drivers enables a new feature called From the Newton release on, OneView drivers enables a new feature called
**dynamic allocation** of nodes [6]_. In this model, the driver allocates **dynamic allocation** of nodes [6]_. In this model, the driver allocates
@ -71,14 +72,14 @@ The following requirements apply for both ``iscsi_pxe_oneview`` and
Minimum version supported is 2.0. Minimum version supported is 2.0.
* ``hpOneView`` is a python package containing a client to manage the * ``python-oneviewclient`` is a python package containing a client to manage
communication between ironic and OneView. the communication between ironic and OneView.
Install the ``hpOneView`` module to enable the communication. Minimum version Install the ``python-oneviewclient`` module to enable the communication.
required is 3.2.1 but it is recommended to install the most up-to-date Minimum version required is 2.4.0 but it is recommended to install the most
version:: up-to-date version::
$ pip install "hpOneView>=3.2.1" $ pip install "python-oneviewclient<3.0.0,>=2.4.0"
* ``ironic-inspector`` if using hardware inspection. * ``ironic-inspector`` if using hardware inspection.
@ -96,7 +97,7 @@ Tested platforms
- Proliant BL460c Gen8 - Proliant BL460c Gen8
- Proliant BL460c Gen9 - Proliant BL460c Gen9
- Proliant BL465c Gen8 - Proliant BL465c Gen8
- Proliant DL360 Gen9 - Proliant DL360 Gen9 (starting with python-oneviewclient 2.1.0)
Notice that for the driver to work correctly with Gen8 and Gen9 DL servers Notice that for the driver to work correctly with Gen8 and Gen9 DL servers
in general, the hardware also needs to run version 4.2.3 of iLO, with in general, the hardware also needs to run version 4.2.3 of iLO, with
@ -434,7 +435,7 @@ References
========== ==========
.. [1] HP OneView - https://www.hpe.com/us/en/integrated-systems/software.html .. [1] HP OneView - https://www.hpe.com/us/en/integrated-systems/software.html
.. [2] :ref:`architecture_drivers` .. [2] :ref:`architecture_drivers`
.. [3] hpOneView - https://pypi.python.org/pypi/hpOneView .. [3] python-oneviewclient - https://pypi.python.org/pypi/python-oneviewclient
.. [6] Dynamic Allocation in OneView drivers - http://specs.openstack.org/openstack/ironic-specs/specs/not-implemented/oneview-drivers-dynamic-allocation.html .. [6] Dynamic Allocation in OneView drivers - http://specs.openstack.org/openstack/ironic-specs/specs/not-implemented/oneview-drivers-dynamic-allocation.html
.. [7] ironic-oneviewd - https://pypi.python.org/pypi/ironic-oneviewd/ .. [7] ironic-oneviewd - https://pypi.python.org/pypi/ironic-oneviewd/
.. [8] ironic-oneview-cli - https://pypi.python.org/pypi/ironic-oneview-cli/ .. [8] ironic-oneview-cli - https://pypi.python.org/pypi/ironic-oneview-cli/

View File

@ -7,9 +7,10 @@
proliantutils>=2.4.1 proliantutils>=2.4.1
pysnmp pysnmp
python-ironic-inspector-client>=1.5.0 python-ironic-inspector-client>=1.5.0
python-oneviewclient<3.0.0,>=2.5.2
python-scciclient>=0.5.0 python-scciclient>=0.5.0
python-ilorest-library>=1.9.2 python-ilorest-library>=1.9.2
hpOneView>=3.2.1 hpOneView<4.0.0,>=3.2.1
UcsSdk==0.8.2.2 UcsSdk==0.8.2.2
python-dracclient>=1.3.0 python-dracclient>=1.3.0

View File

@ -40,6 +40,7 @@ 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 management as irmc_management
from ironic.drivers.modules.irmc import power as irmc_power from ironic.drivers.modules.irmc import power as irmc_power
from ironic.drivers.modules import iscsi_deploy from ironic.drivers.modules import iscsi_deploy
from ironic.drivers.modules.oneview import common as oneview_common
from ironic.drivers.modules.oneview import management as oneview_management from ironic.drivers.modules.oneview import management as oneview_management
from ironic.drivers.modules.oneview import power as oneview_power from ironic.drivers.modules.oneview import power as oneview_power
from ironic.drivers.modules import pxe from ironic.drivers.modules import pxe
@ -218,14 +219,19 @@ class FakeCIMCDriver(base.BaseDriver):
class FakeOneViewDriver(base.BaseDriver): class FakeOneViewDriver(base.BaseDriver):
"""Fake OneView driver. For testing purposes.""" """Fake OneView driver. For testing purposes. """
def __init__(self): def __init__(self):
if not importutils.try_import('hpOneView.oneview_client'): if not importutils.try_import('oneview_client.client'):
raise exception.DriverLoadError( raise exception.DriverLoadError(
driver=self.__class__.__name__, driver=self.__class__.__name__,
reason=_("Unable to import hpOneView library")) reason=_("Unable to import python-oneviewclient library"))
# Checks connectivity to OneView and version compatibility on driver
# initialization
oneview_client = oneview_common.get_oneview_client()
oneview_client.verify_oneview_version()
oneview_client.verify_credentials()
self.power = oneview_power.OneViewPower() self.power = oneview_power.OneViewPower()
self.management = oneview_management.OneViewManagement() self.management = oneview_management.OneViewManagement()
self.boot = fake.FakeBoot() self.boot = fake.FakeBoot()

View File

@ -25,10 +25,20 @@ from ironic.drivers import utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
# NOTE(mrtenio): hpOneView will be the default library for OneView. It
# is being introduced together with the python-oneviewclient to be used
# generally by other patches. python-oneviewclient will be removed
# subsequently.
client = importutils.try_import('oneview_client.client')
oneview_utils = importutils.try_import('oneview_client.utils')
oneview_states = importutils.try_import('oneview_client.states')
oneview_exceptions = importutils.try_import('oneview_client.exceptions')
hponeview_client = importutils.try_import('hpOneView.oneview_client') hponeview_client = importutils.try_import('hpOneView.oneview_client')
redfish = importutils.try_import('redfish') redfish = importutils.try_import('redfish')
client_exception = importutils.try_import('hpOneView.exceptions') client_exception = importutils.try_import('hpOneView.exceptions')
REQUIRED_ON_DRIVER_INFO = { REQUIRED_ON_DRIVER_INFO = {
'server_hardware_uri': _("Server Hardware URI. Required in driver_info."), 'server_hardware_uri': _("Server Hardware URI. Required in driver_info."),
} }
@ -65,6 +75,25 @@ NODE_IN_USE_BY_ONEVIEW = 'node in use by OneView'
SERVER_HARDWARE_ALLOCATION_ERROR = 'server hardware allocation error' SERVER_HARDWARE_ALLOCATION_ERROR = 'server hardware allocation error'
def get_oneview_client():
"""Generate an instance of the OneView client.
Generates an instance of the OneView client using the imported
oneview_client library.
:returns: an instance of the OneView client
"""
oneview_client = client.Client(
manager_url=CONF.oneview.manager_url,
username=CONF.oneview.username,
password=CONF.oneview.password,
allow_insecure_connections=CONF.oneview.allow_insecure_connections,
tls_cacert_file=CONF.oneview.tls_cacert_file,
max_polling_attempts=CONF.oneview.max_polling_attempts
)
return oneview_client
def prepare_manager_url(manager_url): def prepare_manager_url(manager_url):
# NOTE(mrtenio) python-oneviewclient uses https or http in the manager_url # NOTE(mrtenio) python-oneviewclient uses https or http in the manager_url
# while python-hpOneView does not. This will not be necessary when # while python-hpOneView does not. This will not be necessary when
@ -76,9 +105,9 @@ def prepare_manager_url(manager_url):
def get_hponeview_client(): def get_hponeview_client():
"""Generate an instance of the HPE OneView client. """Generate an instance of the hpOneView client.
Generates an instance of the HPE OneView client using the hpOneView lib. Generates an instance of the hpOneView client using the hpOneView library.
:returns: an instance of the OneViewClient :returns: an instance of the OneViewClient
:raises: InvalidParameterValue if mandatory information is missing on the :raises: InvalidParameterValue if mandatory information is missing on the

View File

@ -221,6 +221,7 @@ class OneViewIscsiDeploy(iscsi_deploy.ISCSIDeploy, OneViewPeriodicTasks):
def __init__(self): def __init__(self):
super(OneViewIscsiDeploy, self).__init__() super(OneViewIscsiDeploy, self).__init__()
self.client = common.get_hponeview_client() self.client = common.get_hponeview_client()
self.oneview_client = common.get_oneview_client()
def get_properties(self): def get_properties(self):
return deploy_utils.get_properties() return deploy_utils.get_properties()
@ -264,6 +265,7 @@ class OneViewAgentDeploy(agent.AgentDeploy, OneViewPeriodicTasks):
def __init__(self): def __init__(self):
super(OneViewAgentDeploy, self).__init__() super(OneViewAgentDeploy, self).__init__()
self.client = common.get_hponeview_client() self.client = common.get_hponeview_client()
self.oneview_client = common.get_oneview_client()
def get_properties(self): def get_properties(self):
return deploy_utils.get_properties() return deploy_utils.get_properties()

View File

@ -26,6 +26,8 @@ from ironic.drivers.modules.oneview import common
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
client_exception = importutils.try_import('hpOneView.exceptions') client_exception = importutils.try_import('hpOneView.exceptions')
oneview_exception = importutils.try_import('oneview_client.exceptions')
oneview_utils = importutils.try_import('oneview_client.utils')
def get_properties(): def get_properties():
@ -199,7 +201,7 @@ def is_node_in_use_by_oneview(client, node):
def is_node_in_use_by_ironic(client, node): def is_node_in_use_by_ironic(client, node):
"""Check if node is in use by ironic in OneView. """Check if node is in use by ironic in OneView.
:param client: an instance of the HPE OneView client :param client: an instance of the OneView client
:param node: an ironic node object :param node: an ironic node object
:returns: Boolean value. True if node is in use by ironic, :returns: Boolean value. True if node is in use by ironic,
False otherwise. False otherwise.

View File

@ -15,6 +15,7 @@
from futurist import periodics from futurist import periodics
from ironic_lib import metrics_utils from ironic_lib import metrics_utils
from oslo_utils import importutils
from ironic.common import exception from ironic.common import exception
from ironic.common import states from ironic.common import states
@ -26,6 +27,9 @@ from ironic.drivers.modules.oneview import deploy_utils
METRICS = metrics_utils.get_metrics_logger(__name__) METRICS = metrics_utils.get_metrics_logger(__name__)
oneview_exception = importutils.try_import('oneview_client.exceptions')
oneview_utils = importutils.try_import('oneview_client.utils')
class OneViewInspect(inspector.Inspector): class OneViewInspect(inspector.Inspector):
"""Interface for in band inspection.""" """Interface for in band inspection."""
@ -33,6 +37,7 @@ class OneViewInspect(inspector.Inspector):
def __init__(self): def __init__(self):
super(OneViewInspect, self).__init__() super(OneViewInspect, self).__init__()
self.client = common.get_hponeview_client() self.client = common.get_hponeview_client()
self.oneview_client = common.get_oneview_client()
def get_properties(self): def get_properties(self):
return deploy_utils.get_properties() return deploy_utils.get_properties()
@ -62,7 +67,7 @@ class OneViewInspect(inspector.Inspector):
def inspect_hardware(self, task): def inspect_hardware(self, task):
profile_name = 'Ironic Inspecting [%s]' % task.node.uuid profile_name = 'Ironic Inspecting [%s]' % task.node.uuid
deploy_utils.allocate_server_hardware_to_ironic( deploy_utils.allocate_server_hardware_to_ironic(
self.client, task.node, profile_name self.oneview_client, task.node, profile_name
) )
return super(OneViewInspect, self).inspect_hardware(task) return super(OneViewInspect, self).inspect_hardware(task)

View File

@ -26,6 +26,7 @@ from ironic.drivers.modules.oneview import common
from ironic.drivers.modules.oneview import deploy_utils from ironic.drivers.modules.oneview import deploy_utils
client_exception = importutils.try_import('hpOneView.exceptions') client_exception = importutils.try_import('hpOneView.exceptions')
oneview_exceptions = importutils.try_import('oneview_client.exceptions')
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
METRICS = metrics_utils.get_metrics_logger(__name__) METRICS = metrics_utils.get_metrics_logger(__name__)
@ -166,6 +167,7 @@ class OneViewManagement(base.ManagementInterface):
def __init__(self): def __init__(self):
super(OneViewManagement, self).__init__() super(OneViewManagement, self).__init__()
self.client = common.get_hponeview_client() self.client = common.get_hponeview_client()
self.oneview_client = common.get_oneview_client()
def get_properties(self): def get_properties(self):
return deploy_utils.get_properties() return deploy_utils.get_properties()
@ -190,6 +192,7 @@ class OneViewManagement(base.ManagementInterface):
try: try:
common.validate_oneview_resources_compatibility(self.client, task) common.validate_oneview_resources_compatibility(self.client, task)
if not deploy_utils.is_node_in_use_by_ironic( if not deploy_utils.is_node_in_use_by_ironic(
self.client, task.node self.client, task.node
): ):

View File

@ -27,6 +27,7 @@ from ironic.drivers.modules.oneview import deploy_utils
from ironic.drivers.modules.oneview import management from ironic.drivers.modules.oneview import management
client_exception = importutils.try_import('hpOneView.exceptions') client_exception = importutils.try_import('hpOneView.exceptions')
oneview_exceptions = importutils.try_import('oneview_client.exceptions')
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
METRICS = metrics_utils.get_metrics_logger(__name__) METRICS = metrics_utils.get_metrics_logger(__name__)
@ -59,6 +60,7 @@ class OneViewPower(base.PowerInterface):
def __init__(self): def __init__(self):
super(OneViewPower, self).__init__() super(OneViewPower, self).__init__()
self.client = common.get_hponeview_client() self.client = common.get_hponeview_client()
self.oneview_client = common.get_oneview_client()
def get_properties(self): def get_properties(self):
return deploy_utils.get_properties() return deploy_utils.get_properties()

View File

@ -21,6 +21,7 @@ from ironic.common.i18n import _
from ironic.drivers import base from ironic.drivers import base
from ironic.drivers import generic from ironic.drivers import generic
from ironic.drivers.modules import noop from ironic.drivers.modules import noop
from ironic.drivers.modules.oneview import common
from ironic.drivers.modules.oneview import deploy from ironic.drivers.modules.oneview import deploy
from ironic.drivers.modules.oneview import inspect from ironic.drivers.modules.oneview import inspect
from ironic.drivers.modules.oneview import management from ironic.drivers.modules.oneview import management
@ -56,7 +57,7 @@ class OneViewHardware(generic.GenericHardware):
class AgentPXEOneViewDriver(base.BaseDriver): class AgentPXEOneViewDriver(base.BaseDriver):
"""OneViewDriver using HPE OneViewClient interface. """OneViewDriver using OneViewClient interface.
This driver implements the `core` functionality using This driver implements the `core` functionality using
:class:ironic.drivers.modules.oneview.power.OneViewPower for power :class:ironic.drivers.modules.oneview.power.OneViewPower for power
@ -65,11 +66,21 @@ class AgentPXEOneViewDriver(base.BaseDriver):
""" """
def __init__(self): def __init__(self):
if not importutils.try_import('oneview_client.client'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import python-oneviewclient library"))
if not importutils.try_import('hpOneView.oneview_client'): if not importutils.try_import('hpOneView.oneview_client'):
raise exception.DriverLoadError( raise exception.DriverLoadError(
driver=self.__class__.__name__, driver=self.__class__.__name__,
reason=_("Unable to import hpOneView library")) reason=_("Unable to import hpOneView library"))
# Checks connectivity to OneView and version compatibility on driver
# initialization
oneview_client = common.get_oneview_client()
oneview_client.verify_oneview_version()
oneview_client.verify_credentials()
self.power = power.OneViewPower() self.power = power.OneViewPower()
self.management = management.OneViewManagement() self.management = management.OneViewManagement()
self.boot = pxe.PXEBoot() self.boot = pxe.PXEBoot()
@ -79,7 +90,7 @@ class AgentPXEOneViewDriver(base.BaseDriver):
class ISCSIPXEOneViewDriver(base.BaseDriver): class ISCSIPXEOneViewDriver(base.BaseDriver):
"""OneViewDriver using HPE OneViewClient interface. """OneViewDriver using OneViewClient interface.
This driver implements the `core` functionality using This driver implements the `core` functionality using
:class:ironic.drivers.modules.oneview.power.OneViewPower for power :class:ironic.drivers.modules.oneview.power.OneViewPower for power
@ -88,11 +99,21 @@ class ISCSIPXEOneViewDriver(base.BaseDriver):
""" """
def __init__(self): def __init__(self):
if not importutils.try_import('oneview_client.client'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import python-oneviewclient library"))
if not importutils.try_import('hpOneView.oneview_client'): if not importutils.try_import('hpOneView.oneview_client'):
raise exception.DriverLoadError( raise exception.DriverLoadError(
driver=self.__class__.__name__, driver=self.__class__.__name__,
reason=_("Unable to import hpOneView library")) reason=_("Unable to import hpOneView library"))
# Checks connectivity to OneView and version compatibility on driver
# initialization
oneview_client = common.get_oneview_client()
oneview_client.verify_oneview_version()
oneview_client.verify_credentials()
self.power = power.OneViewPower() self.power = power.OneViewPower()
self.management = management.OneViewManagement() self.management = management.OneViewManagement()
self.boot = pxe.PXEBoot() self.boot = pxe.PXEBoot()

View File

@ -25,7 +25,8 @@ from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.db import utils as db_utils from ironic.tests.unit.db import utils as db_utils
from ironic.tests.unit.objects import utils as obj_utils from ironic.tests.unit.objects import utils as obj_utils
hponeview_client = importutils.try_import('hpOneView.oneview_client') hponeview_client = importutils.try_import('oneview_client.client')
oneview_states = importutils.try_import('oneview_client.states')
class OneViewCommonTestCase(db_base.DbTestCase): class OneViewCommonTestCase(db_base.DbTestCase):

View File

@ -14,6 +14,7 @@
# under the License. # under the License.
import mock import mock
from oslo_utils import importutils
from ironic.common import driver_factory from ironic.common import driver_factory
from ironic.common import exception from ironic.common import exception
@ -30,6 +31,8 @@ from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.db import utils as db_utils from ironic.tests.unit.db import utils as db_utils
from ironic.tests.unit.objects import utils as obj_utils from ironic.tests.unit.objects import utils as obj_utils
oneview_models = importutils.try_import('oneview_client.models')
METHODS = ['iter_nodes', 'update_node', 'do_provisioning_action'] METHODS = ['iter_nodes', 'update_node', 'do_provisioning_action']
PXE_DRV_INFO_DICT = db_utils.get_test_pxe_driver_info() PXE_DRV_INFO_DICT = db_utils.get_test_pxe_driver_info()
PXE_INST_INFO_DICT = db_utils.get_test_pxe_instance_info() PXE_INST_INFO_DICT = db_utils.get_test_pxe_instance_info()
@ -83,6 +86,7 @@ class OneViewDriverDeploy(deploy.OneViewPeriodicTasks):
def __init__(self): def __init__(self):
self.client = mock.MagicMock() self.client = mock.MagicMock()
self.oneview_client = mock.MagicMock()
@mock.patch('ironic.objects.Node', spec_set=True, autospec=True) @mock.patch('ironic.objects.Node', spec_set=True, autospec=True)

View File

@ -29,7 +29,10 @@ from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.db import utils as db_utils from ironic.tests.unit.db import utils as db_utils
from ironic.tests.unit.objects import utils as obj_utils from ironic.tests.unit.objects import utils as obj_utils
client_exception = importutils.try_import('hpOneView.exceptions') client_exception = importutils.try_import('hpOneView.exceptions')
oneview_exceptions = importutils.try_import('oneview_client.exceptions')
oneview_models = importutils.try_import('oneview_client.models')
@mock.patch.object(common, 'get_hponeview_client') @mock.patch.object(common, 'get_hponeview_client')

View File

@ -31,6 +31,8 @@ from ironic.tests.unit.db import utils as db_utils
from ironic.tests.unit.objects import utils as obj_utils from ironic.tests.unit.objects import utils as obj_utils
client_exception = importutils.try_import('hpOneView.exceptions') client_exception = importutils.try_import('hpOneView.exceptions')
oneview_models = importutils.try_import('oneview_client.models')
oneview_exceptions = importutils.try_import('oneview_client.exceptions')
@mock.patch.object(common, 'get_hponeview_client') @mock.patch.object(common, 'get_hponeview_client')

View File

@ -123,6 +123,26 @@ SCCICLIENT_VIOM_CONF_SPEC = (
'terminate', 'terminate',
) )
ONEVIEWCLIENT_SPEC = (
'client',
'states',
'exceptions',
'models',
'utils',
)
ONEVIEWCLIENT_CLIENT_CLS_SPEC = (
)
ONEVIEWCLIENT_STATES_SPEC = (
'ONEVIEW_POWER_OFF',
'ONEVIEW_POWERING_OFF',
'ONEVIEW_POWER_ON',
'ONEVIEW_POWERING_ON',
'ONEVIEW_RESETTING',
'ONEVIEW_ERROR',
)
HPONEVIEW_SPEC = ( HPONEVIEW_SPEC = (
'oneview_client', 'oneview_client',
'resources', 'resources',

View File

@ -25,6 +25,7 @@ Current list of mocked libraries:
- proliantutils - proliantutils
- pysnmp - pysnmp
- scciclient - scciclient
- oneview_client
- hpOneView - hpOneView
- pywsman - pywsman
- python-dracclient - python-dracclient
@ -67,6 +68,38 @@ if not proliantutils:
if 'ironic.drivers.ilo' in sys.modules: if 'ironic.drivers.ilo' in sys.modules:
six.moves.reload_module(sys.modules['ironic.drivers.ilo']) six.moves.reload_module(sys.modules['ironic.drivers.ilo'])
oneview_client = importutils.try_import('oneview_client')
if not oneview_client:
oneview_client = mock.MagicMock(spec_set=mock_specs.ONEVIEWCLIENT_SPEC)
sys.modules['oneview_client'] = oneview_client
sys.modules['oneview_client.client'] = oneview_client.client
states = mock.MagicMock(
spec_set=mock_specs.ONEVIEWCLIENT_STATES_SPEC,
ONEVIEW_POWER_OFF='Off',
ONEVIEW_POWERING_OFF='PoweringOff',
ONEVIEW_POWER_ON='On',
ONEVIEW_POWERING_ON='PoweringOn',
ONEVIEW_RESETTING='Resetting',
ONEVIEW_ERROR='error')
sys.modules['oneview_client.states'] = states
sys.modules['oneview_client.exceptions'] = oneview_client.exceptions
sys.modules['oneview_client.utils'] = oneview_client.utils
oneview_client.exceptions.OneViewException = type('OneViewException',
(Exception,), {})
sys.modules['oneview_client.models'] = oneview_client.models
oneview_client_module = importutils.try_import('oneview_client.client')
# NOTE(vdrok): Always mock the oneview client, as it tries to establish
# connection to oneview right in __init__, and stevedore does not seem to care
# about mocks when it loads a module in mock_the_extension_manager
sys.modules['oneview_client.client'].Client = mock.MagicMock(
spec_set=mock_specs.ONEVIEWCLIENT_CLIENT_CLS_SPEC
)
if 'ironic.drivers.oneview' in sys.modules:
six.moves.reload_module(sys.modules['ironic.drivers.modules.oneview'])
hpOneView = importutils.try_import('hpOneView') hpOneView = importutils.try_import('hpOneView')
if not hpOneView: if not hpOneView:
hpOneView = mock.MagicMock(spec_set=mock_specs.HPONEVIEW_SPEC) hpOneView = mock.MagicMock(spec_set=mock_specs.HPONEVIEW_SPEC)

View File

@ -1,6 +0,0 @@
---
upgrade:
- |
The ``oneview`` drivers now use ``hpOneView`` and
``python-ilorest-library`` libraries to communicate with OneView
appliances. The ``python-oneviewclient`` library is no longer used.