hiera-cfn-metadata 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 264e5b375decbab50bff11e6f69c301b2fdba78a
4
- data.tar.gz: 82681972d53139e437971adbab5c2b068b35bdf4
3
+ metadata.gz: 072b4df5e2b9264ae4eb9c84ccdd1df87d886bec
4
+ data.tar.gz: 7ac50fd1ac94054381ce0508ab71dbb71f757415
5
5
  SHA512:
6
- metadata.gz: c93fece7c23e48d56b7a4c25a0ff31e0f2810ac80de630e7d6a7e337344d8cb780b0b90ca19e0fc53b3eb218d343371bfedd1d88cfdf0b14f8b9f05f48f0c2a2
7
- data.tar.gz: eee7d16d5cab0aaffc03396b9af41eb834ab6d42621a7828353791e4875d1ae837113f6343b8d0b7deaa243268700624fe69b6df420e2e36397ea4d0f0f3f947
6
+ metadata.gz: 2288baf6070df3b5004ff17da8dc3029ffe0e143c53d536f150c48d003c9a0e13e52095d981a06f416e2e8b04d779b3e626e00e8f7a0d0ac23b7fcecdf787be7
7
+ data.tar.gz: adbdaf01d2c1da427aa781634725a899fcf9a1dcfee38984030a540ddc576d0f4460093350eed8d8edecf4ea4e0c9ab9e4a42e82e5bdeeb670b45af00f763c05
@@ -63,7 +63,7 @@ module Aws
63
63
  doc = get_instance_identity('document')
64
64
  sig = get_instance_identity('signature')
65
65
  @credentials = Credentials.new(
66
- Base64.encode64(doc),
66
+ Base64.encode64(doc).delete("\n"),
67
67
  sig.delete("\n")
68
68
  )
69
69
  # Pretend that it expires in an hour
@@ -74,9 +74,7 @@ module Aws
74
74
  failed_attempts = 0
75
75
  begin
76
76
  open_connection do |conn|
77
- path = "/latest/dynamic/instance-identity/#{path}"
78
- profile_name = http_get(conn, path).lines.first.strip
79
- http_get(conn, path + profile_name)
77
+ http_get(conn, "/latest/dynamic/instance-identity/#{path}")
80
78
  end
81
79
  rescue *FAILURES
82
80
  if failed_attempts < @retries
@@ -36,7 +36,7 @@ class Hiera
36
36
 
37
37
  def lookup(key, scope, order_override, resolution_type)
38
38
  answer = nil
39
- found = false
39
+ return answer if @datasources.nil?
40
40
 
41
41
  Hiera.debug("[hiera-cfn-metadata] Looking up #{key}")
42
42
 
@@ -44,9 +44,8 @@ class Hiera
44
44
  Hiera.debug("[hiera-cfn-metadata] Looking for data source #{source}")
45
45
 
46
46
  data = @datasources[source]
47
- next if section.nil? or data.empty?
47
+ next if data.empty?
48
48
  next unless data.include?(key)
49
- found = true
50
49
 
51
50
  # for array resolution we just append to the array whatever
52
51
  # we find, we then goes onto the next file and keep adding to
@@ -68,7 +67,7 @@ class Hiera
68
67
  break
69
68
  end
70
69
  end
71
- throw :no_such_key unless found
70
+
72
71
  return answer
73
72
  end
74
73
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiera-cfn-metadata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Sokolowski