[libvirt] [test-API][PATCH 1/3] Delete the duplicate function

Wayne Sun gsun at redhat.com
Fri Aug 17 10:06:24 UTC 2012


Signed-off-by: Wayne Sun <gsun at redhat.com>
---
 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




More information about the libvir-list mailing list