summaryrefslogtreecommitdiffstats
path: root/lib/gce_command.rb
diff options
context:
space:
mode:
authorMatt Woodson <mwoodson@redhat.com>2015-02-24 10:16:20 -0500
committerMatt Woodson <mwoodson@redhat.com>2015-02-24 10:16:20 -0500
commit41ad58a9b9cd59eb5d8bece20d0c1073190d67b4 (patch)
tree7f11cf6a031a5c8b0efe9618c7ec3476c39fcbb8 /lib/gce_command.rb
parentf780d4fa01a1e8b1559d31a7065715317a884ec4 (diff)
parent0d0b7fa2bba160e8d04ba0f67a0de5c7a06499db (diff)
downloadopenshift-41ad58a9b9cd59eb5d8bece20d0c1073190d67b4.tar.gz
openshift-41ad58a9b9cd59eb5d8bece20d0c1073190d67b4.tar.bz2
openshift-41ad58a9b9cd59eb5d8bece20d0c1073190d67b4.tar.xz
openshift-41ad58a9b9cd59eb5d8bece20d0c1073190d67b4.zip
Merge branch 'master' into tower_install
Conflicts: lib/aws_command.rb
Diffstat (limited to 'lib/gce_command.rb')
-rw-r--r--lib/gce_command.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/gce_command.rb b/lib/gce_command.rb
index 54dbf29ba..b7ebee18e 100644
--- a/lib/gce_command.rb
+++ b/lib/gce_command.rb
@@ -10,7 +10,7 @@ module OpenShift
module Ops
class GceCommand < Thor
# WARNING: we do not currently support environments with hyphens in the name
- SUPPORTED_ENVS = %w(prod stg int tint kint test jint amint tdint lint)
+ SUPPORTED_ENVS = %w(prod stg int twiest gshipley kint test jhonce amint tdint lint)
option :type, :required => true, :enum => LaunchHelper.get_gce_host_types,
:desc => 'The host type of the new instances.'
@@ -120,14 +120,20 @@ module OpenShift
ah.run_playbook("playbooks/gce/#{host_type}/terminate.yml")
end
+ option :env, :required => false, :aliases => '-e', :enum => SUPPORTED_ENVS,
+ :desc => 'The environment to list.'
desc "list", "Lists instances."
def list()
hosts = GceHelper.get_hosts()
+ hosts.delete_if { |h| h.env != options[:env] } unless options[:env].nil?
+
+ fmt_str = "%34s %5s %8s %17s %7s"
+
puts
- puts "Instances"
- puts "---------"
- hosts.each { |k| puts " #{k.name}" }
+ 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