owssh 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/owssh.rb +8 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77db2e2ac6e3eeb6f94d3ddc8c84ed948fa1104b
4
- data.tar.gz: 4b5f819799d6cd0d6959ab736f230ee8f049a4bb
3
+ metadata.gz: 9f3516db22ba0702c4d39f65bdb2e64aa9407eb1
4
+ data.tar.gz: e47256725edd0e905d64a53975700381ecc60836
5
5
  SHA512:
6
- metadata.gz: 5aa86518cd9503e1bbd2d10edf422d91651bea741dc5f19781fc0dc6c62043ea108d15013b6a569cfabce909841391e13a339adabf00ebc379598f805f469408
7
- data.tar.gz: cedbcddece6b9104cf9ddca647622412f0bb0df8f4b971ffdc95630a336408b53583d589b29007e0dc3574139c5def4163540ddef8641a35eb5a41b87cfeae85
6
+ metadata.gz: b799403de1532ad01ee54799084075473fbfcaaf611267079e26eea934a1a5c09f94c59ec9f217fe1521b147d083b523bbf4f8e183a7b38fad8a453b19f1fa96
7
+ data.tar.gz: ba57548dea4b5b0709fe491f05c09b4e6dcb2edad3eef716546fcc40e4fea4185185f578dbb9d343533afd3f0f725367cabb89bb0c0f62c69993f00b896c1524
data/lib/owssh.rb CHANGED
@@ -26,7 +26,13 @@ class Owssh
26
26
  instances_json['Instances'].each do |instance|
27
27
  pub_ip = instance['ElasticIp'] || instance['PublicIp'] || "DOWN"
28
28
  priv_ip = instance['PrivateIp'] || "N/A"
29
- type = instance['Hostname'].match(/(.*)\d+/)[1]
29
+ puts "Hostname: #{instance['Hostname']}"
30
+ match = instance['Hostname'].match(/(.*)\d+/) resque nil
31
+ if !match.nil? then
32
+ type = match[1].to_s
33
+ else
34
+ type = "N/A"
35
+ end
30
36
  my_instances[instance['Hostname'].to_s] = { "PUB_IP" => pub_ip.to_s, "PRIV_IP" => priv_ip.to_s, "TYPE" => type }
31
37
  end
32
38
  my_instances
@@ -74,7 +80,7 @@ class Owssh
74
80
  puts "owssh [Stack Name] [Hostname or Type] - SSH to a host in a stack"
75
81
  puts "owssh [Stack Name] [Hostname or Type] \"Your command here\" - SSH to a host in a stack and run a command"
76
82
  puts ""
77
- puts " Type - The type of host. I.E. rails-app, resque, etc..."
83
+ puts " Type - The type of host. I.E. rails-app, resque, etc..."
78
84
  puts " Hostname - The name of the host. I.E. rails-app1, resque1, etc..."
79
85
  exit
80
86
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: owssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Hutchins