Auto-generated patch by python-black
[integration/test.git] / tools / clustering / cluster-deployer / restart.py
index 044e03ee8b410744e8ef39288468d80c94086e49..cf166f245777816c42738edc2cb17a0d20786c41 100755 (executable)
 import argparse
 from remote_host import RemoteHost
 
-parser = argparse.ArgumentParser(description='Cluster Restart')
-parser.add_argument("--rootdir", default="/root",
-                    help="the root directory on the remote host where the distribution is deployed", required=True)
-parser.add_argument("--hosts", default="",
-                    help="a comma separated list of host names or ip addresses", required=True)
-parser.add_argument("--clean", action="store_true", default=False,
-                    help="clean the persistent data for the current deployment")
-parser.add_argument("--user", default="root", help="the SSH username for the remote host(s)")
-parser.add_argument("--password", default="Ecp123", help="the SSH password for the remote host(s)")
+parser = argparse.ArgumentParser(description="Cluster Restart")
+parser.add_argument(
+    "--rootdir",
+    default="/root",
+    help="the root directory on the remote host where the distribution is deployed",
+    required=True,
+)
+parser.add_argument(
+    "--hosts",
+    default="",
+    help="a comma separated list of host names or ip addresses",
+    required=True,
+)
+parser.add_argument(
+    "--clean",
+    action="store_true",
+    default=False,
+    help="clean the persistent data for the current deployment",
+)
+parser.add_argument(
+    "--user", default="root", help="the SSH username for the remote host(s)"
+)
+parser.add_argument(
+    "--password", default="Ecp123", help="the SSH password for the remote host(s)"
+)
 args = parser.parse_args()
 
 
@@ -29,7 +45,7 @@ def main():
         # Connect to the remote host and start doing operations
         remote = RemoteHost(hosts[x], args.user, args.password, args.rootdir)
         remote.kill_controller()
-        if(args.clean):
+        if args.clean:
             remote.exec_cmd("rm -rf " + args.rootdir + "/deploy/current/odl/*journal")
             remote.exec_cmd("rm -rf " + args.rootdir + "/deploy/current/odl/snapshots")
         remote.start_controller(args.rootdir + "/deploy/current")