debut 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- debut (0.0.2)
4
+ debut (0.0.3)
5
5
  fog (>= 1)
6
6
  gli (>= 2.7)
7
7
 
data/lib/debut/aws.rb CHANGED
@@ -27,6 +27,15 @@ module LiveTribe
27
27
  require 'fog'
28
28
 
29
29
  def initialize(attributes)
30
+ attributes = attributes.dup
31
+
32
+ attributes[:use_iam_profile] = !ENV.include?('AWS_ACCESS_KEY')
33
+ attributes[:use_iam_profile] = !ENV.include?('AWS_SECRET_ACCESS_KEY')
34
+
35
+ if attributes[:use_iam_profile]
36
+ puts 'Using IAM profile'
37
+ end
38
+
30
39
  @dns = Fog::DNS.new(attributes)
31
40
 
32
41
  @hostname = LiveTribe::Debut::Debutante::USE_ENVIRONMENT
@@ -155,9 +164,7 @@ module LiveTribe
155
164
  path = INSTANCE_PUBLIC_HOSTNAME_PATH
156
165
  end
157
166
 
158
- metadata = Fog::JSON.decode(connection.get(:path => path, :expects => 200).body)
159
-
160
- hostname = metadata['hostname']
167
+ hostname = connection.get(:path => path, :expects => 200).body
161
168
  end
162
169
 
163
170
  hostname
data/lib/debut/version.rb CHANGED
@@ -16,6 +16,6 @@
16
16
  #
17
17
  module LiveTribe
18
18
  module Debut
19
- VERSION = '0.0.2'
19
+ VERSION = '0.0.3'
20
20
  end
21
21
  end
data/tests/aws_tests.rb CHANGED
@@ -103,8 +103,7 @@ class TestAws < MiniTest::Unit::TestCase
103
103
  aws.hostname = LiveTribe::Debut::Debutante::USE_ENVIRONMENT
104
104
  aws.use_local_hostname = false
105
105
 
106
- meta_data = {:hostname => 'public_hostname'}
107
- Excon.stub({:method => :get, :path => '/latest/meta-data/public-hostname'}, {:status => 200, :body => Fog::JSON.encode(meta_data)})
106
+ Excon.stub({:method => :get, :path => '/latest/meta-data/public-hostname'}, {:status => 200, :body =>'public_hostname'})
108
107
 
109
108
  hostname = aws.send :collect_hostname
110
109
 
@@ -120,8 +119,7 @@ class TestAws < MiniTest::Unit::TestCase
120
119
  aws.hostname = LiveTribe::Debut::Debutante::USE_ENVIRONMENT
121
120
  aws.use_local_hostname = true
122
121
 
123
- meta_data = {:hostname => 'local_hostname'}
124
- Excon.stub({:method => :get, :path => '/latest/meta-data/local-hostname'}, {:status => 200, :body => Fog::JSON.encode(meta_data)})
122
+ Excon.stub({:method => :get, :path => '/latest/meta-data/local-hostname'}, {:status => 200, :body => 'local_hostname'})
125
123
 
126
124
  hostname = aws.send :collect_hostname
127
125
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debut
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: