Signed-off-by: Wayne Sun <gsun@xxxxxxxxxx> --- utils/utils.py | 18 ------------------ 1 files changed, 0 insertions(+), 18 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index eade10d..b174a58 100644 --- a/utils/utils.py +++ b/utils/utils.py @@ -514,24 +514,6 @@ def remote_exec(hostname, username, password, cmd): subproc_flag = 0 return -1 -def remote_exec_pexpect(hostname, username, password, cmd): - """Remote exec function via pexpect""" - user_hostname = "%s@%s" % (username, hostname) - child = pexpect.spawn("/usr/bin/ssh", [user_hostname, cmd], - timeout = 60, maxread = 2000, logfile = None) - #child.logfile = sys.stdout - while True: - index = child.expect(['(yes\/no)', 'password:', pexpect.EOF, - pexpect.TIMEOUT]) - if index == 0: - child.sendline("yes") - elif index == 1: - child.sendline(password) - elif index == 2: - return string.strip(child.before) - elif index == 3: - return "TIMEOUT!!!" - def get_remote_vcpus(hostname, username, password): """Get cpu number of specified host""" cmd = "cat /proc/cpuinfo | grep processor | wc -l" -- 1.7.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list