Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if args.copyhistory:
hc.copy_history(args.copyhistory[0])
if args.stop:
hc.stop()
if args.clean:
hc.clean()
if args.state:
if args.state == "general":
logger.info("---------------------------------------------------------")
logger.info(style.user2("Hadoop Cluster with ID " + str(hc_id)))
logger.info(style.user1(" Version: ") + hc.get_version())
logger.info(style.user1(" Master: ") + str(hc.master))
logger.info(style.user1(" Hosts: ") + str(hc.hosts))
logger.info(style.user1(" Topology: "))
for h in hc.hosts:
logger.info(" " + str(h) + " -> " + str(hc.topology.get_rack(h)))
if hc.initialized:
if hc.running:
logger.info("The cluster is " + style.user3("running"))
else:
logger.info("The cluster is " + style.user3("stopped"))
else:
logger.info("The cluster is not " + style.user3("initialized"))
logger.info("---------------------------------------------------------")
elif args.state == "files":
(stdout, stderr) = hc.execute("fs -lsr /", verbose=False)
if args.copyhistory:
hc.copy_history(args.copyhistory[0])
if args.stop:
hc.stop()
if args.clean:
hc.clean()
if args.state:
if args.state == "general":
logger.info("---------------------------------------------------------")
logger.info(style.user2("Hadoop Cluster with ID " + str(hc_id)))
logger.info(style.user1(" Version: ") + hc.get_version())
logger.info(style.user1(" Master: ") + str(hc.master))
logger.info(style.user1(" Hosts: ") + str(hc.hosts))
logger.info(style.user1(" Topology: "))
for h in hc.hosts:
logger.info(" " + str(h) + " -> " + str(hc.topology.get_rack(h)))
if hc.initialized:
if hc.running:
logger.info("The cluster is " + style.user3("running"))
else:
logger.info("The cluster is " + style.user3("stopped"))
else:
logger.info("The cluster is not " + style.user3("initialized"))
logger.info("---------------------------------------------------------")
elif args.state == "files":
(stdout, stderr) = hc.execute("fs -lsr /", verbose=False)
print ""
if args.stop:
hc.stop()
if args.clean:
hc.clean()
if args.state:
if args.state == "general":
logger.info("---------------------------------------------------------")
logger.info(style.user2("Hadoop Cluster with ID " + str(hc_id)))
logger.info(style.user1(" Version: ") + hc.get_version())
logger.info(style.user1(" Master: ") + str(hc.master))
logger.info(style.user1(" Hosts: ") + str(hc.hosts))
logger.info(style.user1(" Topology: "))
for h in hc.hosts:
logger.info(" " + str(h) + " -> " + str(hc.topology.get_rack(h)))
if hc.initialized:
if hc.running:
logger.info("The cluster is " + style.user3("running"))
else:
logger.info("The cluster is " + style.user3("stopped"))
else:
logger.info("The cluster is not " + style.user3("initialized"))
logger.info("---------------------------------------------------------")
elif args.state == "files":
(stdout, stderr) = hc.execute("fs -lsr /", verbose=False)
print ""
for line in stdout.splitlines():
if not "WARN fs.FileSystem" in line:
hc.copy_history(args.copyhistory[0])
if args.stop:
hc.stop()
if args.clean:
hc.clean()
if args.state:
if args.state == "general":
logger.info("---------------------------------------------------------")
logger.info(style.user2("Hadoop Cluster with ID " + str(hc_id)))
logger.info(style.user1(" Version: ") + hc.get_version())
logger.info(style.user1(" Master: ") + str(hc.master))
logger.info(style.user1(" Hosts: ") + str(hc.hosts))
logger.info(style.user1(" Topology: "))
for h in hc.hosts:
logger.info(" " + str(h) + " -> " + str(hc.topology.get_rack(h)))
if hc.initialized:
if hc.running:
logger.info("The cluster is " + style.user3("running"))
else:
logger.info("The cluster is " + style.user3("stopped"))
else:
logger.info("The cluster is not " + style.user3("initialized"))
logger.info("---------------------------------------------------------")
elif args.state == "files":
(stdout, stderr) = hc.execute("fs -lsr /", verbose=False)
print ""
for line in stdout.splitlines():