src/lsi/utils/hosts.py
def get_host(name):
    """
    Prints the public dns name of `name`, if it exists.

    :param name: The instance name.
    :type name: ``str``
    """
    f = {'instance-state-name': 'running', 'tag:Name': name}
    ec2 = boto.connect_ec2(region=get_region())
    rs = ec2.get_all_instances(filters=f)
    if len(rs) == 0:
        raise Exception('Host "%s" not found' % name)
    print(rs[0].instances[0].public_dns_name)
def get_host(name):
    """
    Prints the public dns name of `name`, if it exists.

    :param name: The instance name.
    :type name: ``str``
    """
    f = {'instance-state-name': 'running', 'tag:Name': name}
    ec2 = boto.connect_ec2(region=get_region())
    rs = ec2.get_all_instances(filters=f)
    if len(rs) == 0:
        raise Exception('Host "%s" not found' % name)
    print(rs[0].instances[0].public_dns_name)
Prints the public dns name of `name`, if it exists.

    :param name: The instance name.
    :type name: ``str``