This script was broken - using wrong web_server parameter when calling
frontend.AFE; also added user that can be specified on the command line
and removed the code that deletes the host from original server -
it is easy to do using other means but there are use cases when one
might want to keep it.

Signed-off-by: Julius Gawlas <[email protected]>
---
 cli/autotest-rpc-migrate-host |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/cli/autotest-rpc-migrate-host b/cli/autotest-rpc-migrate-host
index 4d02c97..b305080 100755
--- a/cli/autotest-rpc-migrate-host
+++ b/cli/autotest-rpc-migrate-host
@@ -8,16 +8,16 @@ except ImportError:
 from autotest.server import frontend
 
 try:
-    old = frontend.AFE(web_server='http://' + sys.argv[1])
-    new = frontend.AFE(web_server='http://' + sys.argv[2])
+    old = frontend.AFE(user=sys.argv[1], server=sys.argv[2])
+    new = frontend.AFE(user=sys.argv[1], server=sys.argv[3])
 
-    hostname = sys.argv[3]
+    hostname = sys.argv[4]
     print 'Migrating %s ...' % hostname
 
     old_host = old.get_hosts(hostname=hostname)[0]
     print old_host
 except Exception:
-    print ("Usage: %s <old_server> <new_server> <hostname>" %
+    print ("Usage: %s <user> <old_server> <new_server> <hostname>" %
            os.path.basename(sys.argv[0]))
     raise
     sys.exit(1)
@@ -65,5 +65,3 @@ for acl in old_host_acls:
 if not old_host.locked:
     new_host.modify(locked=False)
 
-# Delete host from old server
-old_host.delete()
-- 
1.7.7.6

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to