Explorar o código

minor cleanup

Thomas Wiest %!s(int64=10) %!d(string=hai) anos
pai
achega
1017adbe78
Modificáronse 2 ficheiros con 4 adicións e 3 borrados
  1. 2 2
      lib/aws_command.rb
  2. 2 1
      lib/aws_helper.rb

+ 2 - 2
lib/aws_command.rb

@@ -108,8 +108,8 @@ module OpenShift
         fmt_str = "%34s %5s %8s %17s %7s"
 
         puts
-        puts fmt_str % ['Name','Env', 'State', 'IP', 'Created By']
-        puts fmt_str % ['----','---', '-----', '--', '----------']
+        puts fmt_str % ['Name','Env', 'State', 'IP Address', 'Created By']
+        puts fmt_str % ['----','---', '-----', '----------', '----------']
         hosts.each { |h| puts fmt_str % [h.name, h.env, h.state, h.public_ip, h.created_by ] }
         puts
       end

+ 2 - 1
lib/aws_helper.rb

@@ -37,7 +37,8 @@ module OpenShift
         hosts = get_list()
         dns_names = hosts["tag_Name_#{host}"]
 
-        raise "Error: host not found [#{host}]" if dns_names.nil?
+        raise "Host not found [#{host}]" if dns_names.nil?
+        raise "Multiple entries found for [#{host}]" if dns_names.size > 1
 
         return hosts['_meta']['hostvars'][dns_names.first]
       end