8
usage = """Print hostnames for units participating in an application
14
will print the hostnames of the units supporting the nova-compute application
18
if __name__ == '__main__':
19
parser = optparse.OptionParser(usage)
20
(opts, args) = parser.parse_args()
28
app_status = yaml.load(subprocess.check_output(['juju', 'status',
33
for machine in app_status['machines']:
34
hostname = subprocess.check_output(['juju', 'ssh', machine,
36
hostnames.append(hostname)
39
print(' '.join(hostnames))