本文整理汇总了Python中utils.DebugLog.info_print方法的典型用法代码示例。如果您正苦于以下问题:Python DebugLog.info_print方法的具体用法?Python DebugLog.info_print怎么用?Python DebugLog.info_print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils.DebugLog
的用法示例。
在下文中一共展示了DebugLog.info_print方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sendMsg
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def sendMsg(self, server_id, msg_type_id, bStop=False):
DebugLog.info_print("Send Msg via button click with server_id: %d" % server_id)
#server_data = self.getServerData(server_id)
params = [server_id, bStop]
msg = self.msgcoder.encodeMsg(CMDMsg.getCMD(msg_type_id), server_id, params)
self.controller._sendMsg2CommCnt(msg)
示例2: server_task_start
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def server_task_start(self, msg):
'''
For one click button to server installation task
'''
_cmd, _idx, _data = self.msg_coder.decodeMsg(msg)
tmp = eval(_data)
server_id = tmp[0]
_bPause = tmp[1]
server_details_info = self.getServerData(server_id)
_server_cur_phase_str = server_details_info[PHASE]
fsm_manager = self.fsm_manager[int(server_details_info[IDX_ID])]
if _bPause:
fsm_manager.auto_mode = False
return
else:
fsm_manager.auto_mode = True
if CMDMsg.getCMD(INSTALL_VIOS_ONLY) == _cmd:
fsm_manager.update_states_order()
DebugLog.info_print("install vios only update states order")
phase_state = fsm_manager.get_cur_state(_server_cur_phase_str)
#phase = StateBase.get_state_const(PASSWORD_REQUIRED_STAT)
phase = phase_state.get_next_state().get_state_name()
progress = StateBase.get_state_progress_const_name(PRGRS_READY)
DebugLog.info_print("Set Task %d as %s %s" % (server_id, phase, progress))
#fsm_manager.setTaskState(phase, progress)
self.start_server_in_fsm_manager(server_id, phase, progress)
示例3: get_server_slots
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def get_server_slots(self, server_name):
'''get slots info from hmc'''
cmd = "lshwres -r io --rsubtype slot -m %s -F drc_index" % server_name
DebugLog.info_print("get slots %s " % server_name)
server_slots = self.remote_session.interactive_cmds(cmd, "~> ~>", True)
return server_slots
示例4: __init__
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def __init__(self):
'''
Constructor
'''
self.data_created = False
self.data_empty = False
self.file_name = "ippool.dat"
records_dir_name = "records"
if not os.path.exists(records_dir_name):
os.mkdir(records_dir_name)
self.file_name = os.path.join(records_dir_name, self.file_name)
DebugLog.info_print("The ip pool file path: %s." % os.path.abspath(self.file_name))
file_mode = "r+"
if os.path.isfile(self.file_name):
self.data_created = True
file_mode = "r+"
else:
file_mode = "w+"
self.file_handler = open(self.file_name, file_mode)
if self.data_created:
self.read_data(self.file_handler)
else:
self.init_data(self.file_handler)
示例5: update_password
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def update_password(self, machine_name):
'''
update the password for the desired machine
'''
DebugLog.info_print("update the password for the desired machine %s " % machine_name)
resp = self._change_sys_pwd(machine_name)
DebugLog.info_print("response: %s" % resp)
示例6: __del__
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def __del__(self):
'''
destructor for asmieng
logout from asmi page
'''
DebugLog.info_print("asmi engine destructor")
self.logout()
示例7: login
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def login(self, driver, username, password):
'''
Use default configurations in shared_config file to login PD
'''
pd_browser_client = driver
DebugLog.info_print("Login PowerDirector")
assert "PowerDirector" in pd_browser_client.title
DebugLog.info_print("Page title: " + pd_browser_client.title)
pd_browser_client.implicitly_wait(30)
uid_input = pd_browser_client.find_element_by_id("uid")
uid_input.send_keys(username)
p_input = pd_browser_client.find_element_by_id("pword")
p_input.send_keys(password)
login_button = pd_browser_client.find_element_by_xpath("/html/body/div/form/div/p[4]/input")
login_button.click()
expect_welcome_panel = pd_browser_client.find_element_by_id("user_panel")
welcome_text = "PowerDirector"
try:
if welcome_text in expect_welcome_panel.text:
print( expect_welcome_panel.text)
except:
raise Login_Error("Login fails")
pd_browser_client.quit()
return pd_browser_client
示例8: create_vios_lpar
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def create_vios_lpar(self, params_list):
'''create vios lpar'''
params = params_list
if not isinstance(params_list, list):
params = eval(params_list)
server_name, server_sn, server_slots = params
_name = server_sn
_profile_name = '%sprf' % server_sn
self.chk_and_shutdown_remv_lpar(server_name, server_sn)
time.sleep(1)
cmd = 'mksyscfg -r lpar -m %s -i "name=%s,\
profile_name=%s,lpar_env=vioserver,auto_start=1,\
boot_mode=norm,mem_mode=ded,min_mem=2048,\
desired_mem=4096,max_mem=8192,\
proc_mode=shared,min_procs=2,desired_procs=4,\
max_procs=8,min_proc_units=0.5,desired_proc_units=1,\
max_proc_units=2,\
sharing_mode=cap,max_virtual_slots=200,\
\\"io_slots=%s//0\\""' % (server_name,
_name,
_profile_name,
server_slots)
DebugLog.info_print("create vios lpar for %s " % server_name)
self.remote_session.interactive_cmds(cmd, "~> ~>", False)
示例9: logout
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def logout(self):
'''logout from asmi session'''
DebugLog.info_print("log out asmi page")
self.driver.switch_to_default_content()
self.driver.switch_to_frame("status_frame")
self.driver.find_element_by_name("submit").click()
# self.driver.find_element_by_xpath('//*[@id="body-status"]/form/table/tbody/tr/td[1]/input').click()
self.driver.quit()
示例10: __init__
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def __init__(self, parent):
'''
Constructor
'''
DebugLog.info_print("Construct Log Panel")
self.frame = Frame.__init__(self, parent)
self.pack()
self.createWidgets()
示例11: __init__
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def __init__(self, vd_comm_cnt, vd_config):
'''
Constructor
'''
DebugLog.info_print("EngineBase is initialized")
self.msg_decoder = MsgCodec()
self.vd_comm_cnt = vd_comm_cnt
self.vd_config = vd_config
示例12: __init__
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def __init__(self, vd_comm_cnt, vd_config):
DebugLog.info_print("HMCEng initialized")
EngineBase.__init__(self, vd_comm_cnt, vd_config)
try:
self.hmc_ip = self.vd_config.get('topo', 'hmc_ip')
self.hmc_passwd = self.vd_config.get('topo', 'hmc_passwd')
except:
raise ConfigFileError()
示例13: send_cmd
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def send_cmd(self, cmd):
'''execute the command, and return the output'''
self.connectSSH()
time.sleep(0.5)
cmds = cmd.split(';')
DebugLog.info_print("Session cmd: %s" % cmd)
self.channel.send(cmd + "\n")
time.sleep(1)
示例14: check_license_accepted_and_rootuser_enabled
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def check_license_accepted_and_rootuser_enabled(self, _server_id, data):
'''
check license if accepted and test whether the root role command
'''
'''
Capture login: prompt, then input padmin as password
license accept
'''
bFinished = False
_ip = eval(data)
ip = _ip[0]
change_passwd_sign = "padmin's New password:"
login_passwd_sign = "padmin's Password:"
accept_license_sign = "Accept (a) | Decline (d) | View Terms (v)"
shell_prompt_sign = "$"
rootuser_prompt_sign = "#"
try:
tn = telnetlib.Telnet(ip)
ret = ""
ret = tn.read_until("login: ", 5)
DebugLog.info_print("print accept license6")
if ret:
tn.write("padmin\r\n")
read_cont = tn.read_until("padmin's New password:", 10)
DebugLog.info_print("print accept license7")
read_cont = read_cont.strip()
if read_cont.endswith(login_passwd_sign):
tn.write("padmin\r\n")
read_cont = tn.read_until(shell_prompt_sign, 10)
if read_cont.strip().endswith(shell_prompt_sign):
tn.write("ls -l \r\n")
read_cont = tn.read_until(shell_prompt_sign, 10)
if read_cont.strip().endswith(shell_prompt_sign):
bFinished = True
except Exception:
bFinished = False
if bFinished:
try:
tn = telnetlib.Telnet(host=ip, port=22)
ret = tn.read_until("SSH-", 10)
except Exception, e:
if isinstance(e, EOFError):
ret = None
if not ret:
bFinished = False
示例15: server_scan
# 需要导入模块: from utils import DebugLog [as 别名]
# 或者: from utils.DebugLog import info_print [as 别名]
def server_scan(self):
'''
connect hmc as a session
issue the command:
return: IP,SN,Status
'''
DebugLog.info_print("scan the dhcp client ip and the respective sn")
self.make_sys_connection_auto()
results = self.get_managed_sys_info()
return results