owssh 0.0.18 → 0.0.20

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 +5 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8dcd2935588851699227b12f86a10bcc9e5763d
4
- data.tar.gz: 64dcc6519a071a1062e137667ffade6cdbd6237d
3
+ metadata.gz: 7221dddfa2ad3f3485d227fede880a2bf1934af1
4
+ data.tar.gz: 98ea134bf194d5833f1b906ee7a7cda30281c572
5
5
  SHA512:
6
- metadata.gz: 7bf811a8ba049a4fa3c065a351b672224990808f33ed5c255b2db101ff36f3ef84c967d06c1af0cdaa0f55d05aa0fef6327fabf5ccdd2c1faf4b1d1262f802bc
7
- data.tar.gz: afc9bb01f79aa599f52ba327080eae321ba3d5e9f6ed504251075cdfbf367430107280e5bf2794ccb0843fbd18eb4fdf448fe2fbef94179e85a2748322c8c776
6
+ metadata.gz: 19d2a1e81ddd71555166cf57aa87b8893e107d738a50a191b0f564750150da2bb8e4697fbdf7d1d03869d3560ec7a26ab45929437de24be971087976ac4d67c5
7
+ data.tar.gz: ac27448595151c13448025ecf03e84fca72e707be427b2285ec2c151ad83b5f16c33a01f0f459e626bc1abd0953e08a10f266b7bb9c43f5cc0af2437ac53e075
data/lib/owssh.rb CHANGED
@@ -8,9 +8,12 @@ require 'command_line_reporter'
8
8
  class Owssh
9
9
  include CommandLineReporter
10
10
 
11
+ $aws_profile = "default"
12
+ $aws_config_file = "~/.aws/config.owssh"
13
+
11
14
  def get_stacks
12
15
  my_stacks = {}
13
- stacks_json = JSON.parse(`aws opsworks describe-stacks`)
16
+ stacks_json = JSON.parse(`AWS_CONFIG_FILE=#{$aws_config_file} aws --profile #{$aws_profile} opsworks describe-stacks`)
14
17
 
15
18
  stacks_json['Stacks'].each do |stack|
16
19
  if $debug then puts "Stack Name: #{stack['Name'].gsub(' ','_').downcase} Stack ID: #{stack['StackId']}" end
@@ -22,7 +25,7 @@ class Owssh
22
25
 
23
26
  def get_instances(id)
24
27
  my_instances = {}
25
- instances_json = JSON.parse(`aws opsworks describe-instances --stack-id #{id}`)
28
+ instances_json = JSON.parse(`AWS_CONFIG_FILE=#{$aws_config_file} aws --profile #{$aws_profile} opsworks describe-instances --stack-id #{id}`)
26
29
  instances_json['Instances'].each do |instance|
27
30
  pub_ip = instance['ElasticIp'] || instance['PublicIp'] || "DOWN"
28
31
  priv_ip = instance['PrivateIp'] || "N/A"
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.18
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Hutchins