How to use the execo.log.style.user3 function in execo

To help you get started, we’ve selected a few execo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mliroz / hadoop_g5k / scripts / hg5k.py View on Github external
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:
                    print line
            print ""
            
            (stdout, stderr) = hc.execute("fs -dus /", verbose=False)
            pos = stdout.rfind("\t")
            size = int(stdout[pos + 1:])
            
            human_readable_size = ""
            if 1024 < size < 1024*1024:
github mliroz / hadoop_g5k / scripts / hg5k.py View on Github external
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:
                    print line
            print ""
            
            (stdout, stderr) = hc.execute("fs -dus /", verbose=False)
            pos = stdout.rfind("\t")
github mliroz / hadoop_g5k / scripts / hg5k.py View on Github external
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:
                    print line
            print ""
            
            (stdout, stderr) = hc.execute("fs -dus /", verbose=False)
            pos = stdout.rfind("\t")
            size = int(stdout[pos + 1:])