- hostname = raw_input("Hostname: ")
- try:
- host = db.host(hostname)
- except hostdb.NoSuchHost, e:
- print "No such host '%s'" % e.name
- sys.exit(1)
- if host.fqdn:
- opt_fqdn = " (%s)" % host.fqdn
- else:
- opt_fqdn = ""
- print "Host: %s%s" % (host.name, opt_fqdn)
- print "Platform: %s" % host.platform
- print "Owner: %s <%s>" % host.owner
+ if not args:
+ args = [raw_input("Hostname: ")]
+ for hostname in args:
+ try:
+ host = buildfarm.hostdb[hostname]
+ except hostdb.NoSuchHost, e:
+ print "No such host '%s'" % e.name
+ sys.exit(1)
+ if host.fqdn:
+ opt_fqdn = " (%s)" % host.fqdn
+ else:
+ opt_fqdn = ""
+ print "Host: %s%s" % (host.name, opt_fqdn)
+ print "Platform: %s" % host.platform
+ print "Owner: %s <%s>" % host.owner