def stop_medusa(self): file_json_step = Define.PATH_SNIC_JSON_LINUX + "medusa_stop.json" Util.run_step_list(self._ssh, file_json_step)
def start_medusa(self, lun_type): file_json_step = None if lun_type == 1: file_json_step = Define.PATH_SNIC_JSON_LINUX + "medusa_start_boot_lun.json" elif lun_type == 2: file_json_step = Define.PATH_SNIC_JSON_LINUX + "medusa_start_data_lun.json" elif lun_type == 3: file_json_step = Define.PATH_SNIC_JSON_LINUX + "medusa_start_all_lun.json" Util.run_step_list(self._ssh, file_json_step)
def run_cmd_step(self, file_json_step): Util.run_step_list(self._ssh, file_json_step)
def create_data_file_system(self): file_json_step = Define.PATH_SNIC_JSON_LINUX + "create_data_file_system.json" Util.run_step_list(self._ssh, file_json_step)
import time from main.define import Define from lib.util import Util from lib.node_head import NodeHead from lib.ucsm import UCSM if __name__ == '__main__': download = False if download: head_node = NodeHead(Define.NODE_HEAD_NAME, Define.NODE_DEFAULT_USERNAME) file_json_step = Define.PATH_SNIC_JSON_LINUX + "wget_ucsm_firmware.json" Util.run_step_list(head_node.get_ssh(), file_json_step) ucsm = UCSM(Define.UCSM_HOSTNAME); ssh = ucsm.get_ssh() for i in range(len(Define.IMAGE_LIST)): ssh.send_expect_prompt("top") ssh.send_expect_prompt("scope firmware") ssh.send("download image " + Define.CMD_SCP_IMAGE_LIST[i]) ssh.expect(Define.PATTERN_PASSWORD) ssh.send_expect_prompt(Define.NODE_DEFAULT_PASSWORD) ssh.send_expect_prompt("scope download-task " + Define.IMAGE_LIST[i]) ret = Util.probe_send_expect(ssh, "show", "Downloaded", 60, 10) if not ret: exit() ssh.send_expect_prompt("top")
''' Created on Aug 26, 2014 @author: huhe ''' from main.define import Define from lib.util import Util from lib.ucsm import UCSM if __name__ == '__main__': ucsm = UCSM(Define.UCSM_HOSTNAME); file_json_step = Define.PATH_SNIC_JSON_UCSM + "basic_setup.json" Util.run_step_list(ucsm.get_ssh(), file_json_step) ucsm.exit()
def create_ipmi_policy(ucsm_ssh, param): file_json_step = Define.PATH_SNIC_JSON_UCSM + "ipmi_policy.json" Util.run_step_list(ucsm_ssh, file_json_step)