How to use the execo.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 / util / g5k.py View on Github external
for job in hosts_str.split(','):
                site, job_id = job.split(':')
                hosts += get_oar_job_nodes(int(job_id), site)
        elif "," in hosts_str:
            # We assume the string is a comma separated list of hosts
            for hstr in hosts_str.split(','):
                h = Host(hstr.rstrip())
                if h not in hosts:
                    hosts.append(h)
        elif hosts_str.isdigit():
            # If the file_name is a number, we assume this is a oargrid_job_id
            hosts = get_oargrid_job_nodes(int(hosts_str))
        else:
            # If not any of the previous, we assume is a single-host cluster
            # where the given input is the only host
            hosts = [Host(hosts_str.rstrip())]

        logger.debug('Hosts list: \n%s',
                     ' '.join(style.host(host.address.split('.')[0])
                              for host in hosts))
        return hosts
github BeyondTheClouds / enos / engine / g5k_engine.py View on Github external
def translate(node):
        splitted = node.address.split(".")
        splitted[0] = "%s-kavlan-%s" % (splitted[0], vlan_id)
        return EX.Host(".".join(splitted))
    return map(translate, nodes)
github mliroz / hadoop_g5k / hadoop_g5k / util / g5k.py View on Github external
"""
        hosts = []
        if os.path.isfile(hosts_str):
            for line in open(hosts_str):
                h = Host(line.rstrip())
                if h not in hosts:
                    hosts.append(h)
        elif ':' in hosts_str:
            # We assume the string is a comma separated list of site:job_id
            for job in hosts_str.split(','):
                site, job_id = job.split(':')
                hosts += get_oar_job_nodes(int(job_id), site)
        elif "," in hosts_str:
            # We assume the string is a comma separated list of hosts
            for hstr in hosts_str.split(','):
                h = Host(hstr.rstrip())
                if h not in hosts:
                    hosts.append(h)
        elif hosts_str.isdigit():
            # If the file_name is a number, we assume this is a oargrid_job_id
            hosts = get_oargrid_job_nodes(int(hosts_str))
        else:
            # If not any of the previous, we assume is a single-host cluster
            # where the given input is the only host
            hosts = [Host(hosts_str.rstrip())]

        logger.debug('Hosts list: \n%s',
                     ' '.join(style.host(host.address.split('.')[0])
                              for host in hosts))
        return hosts
github BeyondTheClouds / enos / engine / g5k_engine.py View on Github external
                                        map(lambda n: EX.Host(n), deployed), vlan[1]),
                                key = lambda n: n.address)