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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 072b4df5e2b9264ae4eb9c84ccdd1df87d886bec
|
4
|
+
data.tar.gz: 7ac50fd1ac94054381ce0508ab71dbb71f757415
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
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
|
-
|
70
|
+
|
72
71
|
return answer
|
73
72
|
end
|
74
73
|
|