Merge "Fix pep8 violations in base"
[integration/test.git] / test / tools / cluster-deployer / remote_host.py
index aebea60e2e79ed6fbd2d64c9b329b9124beddcc4..5da74b77a8a0e259f09f114c4abfce4e5783ba93 100644 (file)
@@ -6,37 +6,37 @@
 
 from SSHLibrary import SSHLibrary
 
+
 class RemoteHost:
-       def __init__(self, host, user, password, rootdir):
-               self.host = host
-               self.user = user
-               self.password = password
-               self.rootdir = rootdir
-
-       def exec_cmd(self, command):
-               print "Executing command " + command + " on host " + self.host
-               lib = SSHLibrary()
-               lib.open_connection(self.host)
-               lib.login(username=self.user,password=self.password)
-               rc = lib.execute_command(command, return_rc = True)
-               lib.close_connection()
-               if rc[1] != 0:
-                  raise Exception('remote command failed [{0}] with exit code {1}'.format(command, rc))
-
-
-       def mkdir(self, dir_name):
-               self.exec_cmd("mkdir -p " + dir_name)
-
-       def copy_file(self, src, dest):
-           lib = SSHLibrary()
-           lib.open_connection(self.host)
-           lib.login(username=self.user, password=self.password)
-           print "Copying " + src + " to " + dest + " on " + self.host
-           lib.put_file(src, dest)
-           lib.close_connection()
-
-       def kill_controller(self):
-           self.exec_cmd("ps axf | grep karaf | grep -v grep | awk '{print \"kill -9 \" $1}' | sh")
-
-       def start_controller(self, dir_name):
-               self.exec_cmd(dir_name + "/odl/bin/start")
+    def __init__(self, host, user, password, rootdir):
+        self.host = host
+        self.user = user
+        self.password = password
+        self.rootdir = rootdir
+
+    def exec_cmd(self, command):
+        print "Executing command " + command + " on host " + self.host
+        lib = SSHLibrary()
+        lib.open_connection(self.host)
+        lib.login(username=self.user, password=self.password)
+        rc = lib.execute_command(command, return_rc=True)
+        lib.close_connection()
+        if rc[1] != 0:
+            raise Exception('remote command failed [{0}] with exit code {1}'.format(command, rc))
+
+    def mkdir(self, dir_name):
+        self.exec_cmd("mkdir -p " + dir_name)
+
+    def copy_file(self, src, dest):
+        lib = SSHLibrary()
+        lib.open_connection(self.host)
+        lib.login(username=self.user, password=self.password)
+        print "Copying " + src + " to " + dest + " on " + self.host
+        lib.put_file(src, dest)
+        lib.close_connection()
+
+    def kill_controller(self):
+        self.exec_cmd("ps axf | grep karaf | grep -v grep | awk '{print \"kill -9 \" $1}' | sh")
+
+    def start_controller(self, dir_name):
+        self.exec_cmd(dir_name + "/odl/bin/start")