コード例 #1
0
def update_ibmi_settings(adapter, instance, boot_type):
    """Update settings of IBMi VMs on the instance.

    :param adapter: The pypowervm adapter.
    :param instance: The nova instance.
    :param boot_type: The boot connectivity type of the instance.
    """
    lpar_wrap = get_instance_wrapper(adapter, instance)
    entry = ibmi.update_ibmi_settings(adapter, lpar_wrap, boot_type)
    entry.update()
コード例 #2
0
ファイル: vm.py プロジェクト: adreznec/nova-powervm
def update_ibmi_settings(adapter, instance, boot_type):
    """Update settings of IBMi VMs on the instance.

    :param adapter: The pypowervm adapter.
    :param instance: The nova instance.
    :param boot_type: The boot connectivity type of the instance.
    """
    lpar_wrap = get_instance_wrapper(adapter, instance)
    entry = ibmi.update_ibmi_settings(adapter, lpar_wrap, boot_type)
    entry.update()
コード例 #3
0
    def _validate_ibmi_settings(self, mock_viosw):
        mock_viosw.return_value = self.vioslist
        mock_lparw = mock.MagicMock()
        mock_lparw.id = 22

        # Test update load source with npiv boot
        boot_type = 'npiv'
        entry = ibmi.update_ibmi_settings(self.apt, mock_lparw, boot_type)
        self._validate_settings(self, boot_type, self.traits, entry)

        # Test update load source with vscsi boot
        boot_type = 'vscsi'
        entry = ibmi.update_ibmi_settings(self.apt, mock_lparw, boot_type)
        self._validate_settings(self, boot_type, self.traits, entry)

        # Test bad path if load source is not found
        mock_lparw.reset_mock()
        mock_lparw.id = 220
        boot_type = 'vscsi'
        self.assertRaises(pvm_exc.IBMiLoadSourceNotFound,
                          ibmi.update_ibmi_settings, self.apt, mock_lparw,
                          boot_type)
コード例 #4
0
ファイル: test_ibmi.py プロジェクト: kairoaraujo/pypowervm
    def _validate_ibmi_settings(self, mock_viosw, mock_cnaw):
        mock_viosw.return_value = self.vioslist
        mock_cnaw.return_value = self.cnalist
        mock_lparw = mock.MagicMock()
        mock_lparw.id = 22

        # Test update load source with npiv boot
        boot_type = 'npiv'
        entry = ibmi.update_ibmi_settings(self.apt, mock_lparw, boot_type)
        self._validate_settings(self, boot_type, self.traits, entry)

        # Test update load source with vscsi boot
        boot_type = 'vscsi'
        entry = ibmi.update_ibmi_settings(self.apt, mock_lparw, boot_type)
        self._validate_settings(self, boot_type, self.traits, entry)

        # Test bad path if load source is not found
        mock_lparw.reset_mock()
        mock_lparw.id = 220
        boot_type = 'vscsi'
        self.assertRaises(pvm_exc.IBMiLoadSourceNotFound,
                          ibmi.update_ibmi_settings, self.apt, mock_lparw,
                          boot_type)