def backup_iscsi_initiator_info(self): if not plugin.is_enabled(self.env, 'emc_vnx'): return bup_file_path = get_iscsi_bup_file_path(self.node) file_dir = os.path.dirname(bup_file_path) if not os.path.exists(file_dir): os.makedirs(file_dir) ssh.sftp(self.node).get(magic_consts.ISCSI_CONFIG_PATH, bup_file_path)
def restore_iscsi_initiator_info(self): if not plugin.is_enabled(self.env, 'emc_vnx'): return bup_file_path = get_iscsi_bup_file_path(self.node) if not os.path.exists(bup_file_path): raise Exception("Backup iscsi configuration is not present for " "compute node %s" % str(self.node.id)) ssh.sftp(self.node).put(bup_file_path, magic_consts.ISCSI_CONFIG_PATH) for service in ["open-iscsi", "multipath-tools", "nova-compute"]: ssh.call(['service', service, 'restart'], node=self.node)
def test_check_plugin(installed, enabled): settings = {"editable": {}} if installed: settings["editable"]["emc_vnx"] = EMC_VNX_SETTINGS settings["editable"]["emc_vnx"]["metadata"]["enabled"] = enabled env = mock.Mock(spec_set=["get_settings_data"]) env.get_settings_data.return_value = settings assert plugin.is_installed(env, "emc_vnx") is installed assert plugin.is_enabled(env, "emc_vnx") is enabled
def test_check_plugin(installed, enabled): settings = {'editable': {}} if installed: settings['editable']['emc_vnx'] = EMC_VNX_SETTINGS settings['editable']['emc_vnx']['metadata']['enabled'] = enabled env = mock.Mock(spec_set=['get_settings_data']) env.get_settings_data.return_value = settings assert plugin.is_installed(env, 'emc_vnx') is installed assert plugin.is_enabled(env, 'emc_vnx') is enabled