Dmitry Tantsur dc05d18b56 Start using in-band inspection
Start using in-band inspection with ironic-discoverd, but do not
instantiate the driver interface when discoverd support is disabled in
the config file.

* Check the CONF option prior to instantiating DiscoverdInspect class
  and binding it to any driver interface
* Updates unit tests to better test the loading (or lack thereof) of the
  driver.inspect interface, based on the CONF option

If in-band discovery is enabled by setting [discoverd] enabled=True in
the config file, then the following drivers will bind it to their
inspect interface:
* pxe_ssh
* pxe_ipmitool
* pxe_ipminative
* pxe_drac

This patch also fixes a few nits (copied from previous reviews).

The bug tagged below presently affects only the "fake" driver. Without
the above-mentioned changes, enabling discoverd for any
production-facing driver would have led to the problem described there.

Updated UnsupportedDriverExtension error message to suggest that
the extension might be disabled.

Co-authored-by: Devananda van der Veen <devananda.vdv@gmail.com>

Closes-bug: #1431999
Implements: blueprint inband-properties-discovery
Change-Id: I1dd844525852b1ec806f286d01dfc95313c6ad94
2015-03-16 17:02:01 +01:00

43 lines
1.5 KiB
Python

#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""
DRAC Driver for remote system management using Dell Remote Access Card.
"""
from oslo_utils import importutils
from ironic.common import exception
from ironic.common.i18n import _
from ironic.drivers import base
from ironic.drivers.modules import discoverd
from ironic.drivers.modules.drac import management
from ironic.drivers.modules.drac import power
from ironic.drivers.modules import pxe
class PXEDracDriver(base.BaseDriver):
"""Drac driver using PXE for deploy."""
def __init__(self):
if not importutils.try_import('pywsman'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_('Unable to import pywsman library'))
self.power = power.DracPower()
self.deploy = pxe.PXEDeploy()
self.management = management.DracManagement()
self.vendor = pxe.VendorPassthru()
self.inspect = discoverd.DiscoverdInspect.create_if_enabled(
'PXEDracDriver')