Example #1
0
    def __init__(self):
        if not importutils.try_import('pywsman'):
            raise exception.DriverLoadError(
                driver=self.__class__.__name__,
                reason=_('Unable to import pywsman library'))

        if not importutils.try_import('dracclient'):
            raise exception.DriverLoadError(
                driver=self.__class__.__name__,
                reason=_('Unable to import python-dracclient library'))

        self.power = power.DracPower()
        self.boot = pxe.PXEBoot()
        self.deploy = iscsi_deploy.ISCSIDeploy()
        self.management = management.DracManagement()
        self.iscsi_vendor = iscsi_deploy.VendorPassthru()
        self.drac_vendor = vendor_passthru.DracVendorPassthru()
        self.mapping = {
            'pass_deploy_info': self.iscsi_vendor,
            'heartbeat': self.iscsi_vendor,
            'pass_bootloader_install_info': self.iscsi_vendor,
            'get_bios_config': self.drac_vendor,
            'set_bios_config': self.drac_vendor,
            'commit_bios_config': self.drac_vendor,
            'abandon_bios_config': self.drac_vendor,
        }
        self.vendor = utils.MixinVendorInterface(self.mapping)
        self.inspect = inspector.Inspector.create_if_enabled('PXEDracDriver')
Example #2
0
    def test_reboot(self, mock_set_power_state):
        driver = drac_power.DracPower()
        task = mock.Mock()
        task.node.return_value = self.node

        driver.reboot(task)
        mock_set_power_state.assert_called_once_with(task.node, states.REBOOT)
Example #3
0
    def __init__(self):
        if not importutils.try_import('dracclient'):
            raise exception.DriverLoadError(
                driver=self.__class__.__name__,
                reason=_('Unable to import python-dracclient library'))

        self.power = power.DracPower()
        self.boot = pxe.PXEBoot()
        self.deploy = deploy.DracDeploy()
        self.management = management.DracManagement()
        self.raid = raid.DracRAID()
        self.iscsi_vendor = iscsi_deploy.VendorPassthru()
        self.drac_vendor = vendor_passthru.DracVendorPassthru()
        self.mapping = {
            'heartbeat': self.iscsi_vendor,
            'get_bios_config': self.drac_vendor,
            'set_bios_config': self.drac_vendor,
            'commit_bios_config': self.drac_vendor,
            'abandon_bios_config': self.drac_vendor,
            'list_unfinished_jobs': self.drac_vendor,
        }
        self.driver_passthru_mapping = {'lookup': self.iscsi_vendor}
        self.vendor = utils.MixinVendorInterface(self.mapping,
                                                 self.driver_passthru_mapping)
        self.inspect = drac_inspect.DracInspect()
Example #4
0
    def test_get_power_state(self, mock_get_power_state):
        mock_get_power_state.return_value = states.POWER_ON
        driver = drac_power.DracPower()
        task = mock.Mock()
        task.node.return_value = self.node

        self.assertEqual(states.POWER_ON, driver.get_power_state(task))
        mock_get_power_state.assert_called_once_with(task.node)
Example #5
0
    def test_set_power_state(self, mock_set_power_state):
        driver = drac_power.DracPower()
        task = mock.Mock()
        task.node.return_value = self.node

        driver.set_power_state(task, states.POWER_ON)
        mock_set_power_state.assert_called_once_with(task.node,
                                                     states.POWER_ON)
Example #6
0
    def __init__(self):
        if not importutils.try_import('pywsman'):
            raise exception.DriverLoadError(
                driver=self.__class__.__name__,
                reason=_('Unable to import pywsman library'))

        self.power = drac_power.DracPower()
        self.deploy = fake.FakeDeploy()
        self.management = drac_mgmt.DracManagement()
Example #7
0
    def __init__(self):
        if not importutils.try_import('dracclient'):
            raise exception.DriverLoadError(
                driver=self.__class__.__name__,
                reason=_('Unable to import python-dracclient library'))

        self.power = drac_power.DracPower()
        self.deploy = fake.FakeDeploy()
        self.management = drac_mgmt.DracManagement()
        self.vendor = drac_vendor.DracVendorPassthru()
Example #8
0
    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()
Example #9
0
    def __init__(self):
        if not importutils.try_import('dracclient'):
            raise exception.DriverLoadError(
                driver=self.__class__.__name__,
                reason=_('Unable to import python-dracclient library'))

        self.power = power.DracPower()
        self.boot = pxe.PXEBoot()
        self.deploy = iscsi_deploy.ISCSIDeploy()
        self.management = management.DracManagement()
        self.raid = raid.DracRAID()
        self.vendor = vendor_passthru.DracVendorPassthru()
        self.inspect = drac_inspect.DracInspect()
Example #10
0
 def test_get_properties(self):
     expected = drac_common.COMMON_PROPERTIES
     driver = drac_power.DracPower()
     self.assertEqual(expected, driver.get_properties())