How to use the execo.log.style.host 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 / hadoop_g5k / cluster.py View on Github external
                              ' '.join(map(lambda x: style.host(x.split('.')[0]), v))
                              for k, v in t.iteritems()])
github mliroz / hadoop_g5k / hadoop_g5k / ecosystem / mahout.py View on Github external
config.add_section("cluster")
        config.add_section("local")

        if config_file:
            config.readfp(open(config_file))

        self.base_dir = config.get("cluster", "mahout_base_dir")
        self.conf_dir = config.get("cluster", "mahout_conf_dir")

        self.bin_dir = self.base_dir + "/bin"

        self.hc = hadoop_cluster

        # Create topology
        logger.info("Mahout cluster created in hosts %s",
                    ' '.join([style.host(h.address.split('.')[0])
                              for h in self.hc.hosts]))
github mliroz / hadoop_g5k / scripts / hg5k.py View on Github external
help="A list of libraries to be used in job execution. "
                             "Applies only to --jarjob")
                        
    verbose_group = actions.add_mutually_exclusive_group()

    verbose_group.add_argument("-v", "--verbose",
                               dest="verbose",
                               action="store_true",
                               help="Run in verbose mode")

    verbose_group.add_argument("-q", "--quiet",
                               dest="quiet",
                               action="store_true",
                               help="Run in quiet mode")

    object_group = parser.add_argument_group(style.host("Object management options"),
                        "Options to create and destroy hadoop cluster objects.")

    object_mutex_group = object_group.add_mutually_exclusive_group()

    object_mutex_group.add_argument("--create",
                              metavar="MACHINELIST",
                              nargs=1,
                              action="store",
                              help="Create the cluster object with the nodes in"
                                   " MACHINELIST file")

    object_mutex_group.add_argument("--delete",
                              dest="delete",
                              action="store_true",
                              help="Remove all files used by the cluster")
github mliroz / hadoop_g5k / scripts / hg5k.py View on Github external
for line in open(file_name):
            h = Host(line.rstrip())
            if not h in hosts:
                hosts.append(h)

        return hosts

    # Main #####################################################################
    prog = "hadoop_g5k"
    description = "This tool helps you to manage a Hadoop cluster in Grid5000."
    parser = ArgumentParser(prog=prog,
                            description=description,
                            formatter_class=RawTextHelpFormatter,
                            add_help=False)

    actions = parser.add_argument_group(style.host("General options"), 
                        "Options to be used generally with hadoop action.s")
                        
    actions.add_argument("-h", "--help",
                        action="help",
                        help="Show this help message and exit")                        

    actions.add_argument("--id",
                        action="store",
                        nargs=1,
                        metavar="ID",
                        help="The identifier of the cluster. If not indicated, "
                             "last used cluster will be used (if any)")

    actions.add_argument("--node",
                        action="store",
                        nargs=1,