MovableInkAWS 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/movable_ink/aws/metadata.rb +1 -1
- data/lib/movable_ink/version.rb +1 -1
- data/spec/aws_spec.rb +1 -1
- data/spec/ec2_spec.rb +2 -2
- data/spec/metadata_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24c0d6fea8ea161fb987f26f1574ce3ee48a1c37cbe7f78cc09d8bef82242729
|
4
|
+
data.tar.gz: 59f455acf804ee9591647a4ccda51066161424ed8992492038721ece13bd58b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6144b91d11de9221998cc636469411dcaa40fed4b5a8cbbd2638549d7b34a1c35578faaeee87474f586695c32f80c2be29447fc8cb7d45c8092ab2e9ae0ddda
|
7
|
+
data.tar.gz: 5bb11e9cd6d9ef69bbebdfd41d57c9e6cbb54b80cebbaa974595ee77c536db586b17f7e343bcc46d6e9380d1410e91a4a15a3ea899bc69c5998f6537d431c0bc
|
data/Gemfile.lock
CHANGED
@@ -43,7 +43,7 @@ module MovableInk
|
|
43
43
|
def imds_token(tries: 3)
|
44
44
|
tries.times do |num|
|
45
45
|
num += 1
|
46
|
-
request = Net::HTTP::
|
46
|
+
request = Net::HTTP::Put.new('/latest/api/token')
|
47
47
|
request['X-aws-ec2-metadata-token-ttl-seconds'] = 120
|
48
48
|
response = http(timeout_seconds: num * 3).request(request)
|
49
49
|
return response.body
|
data/lib/movable_ink/version.rb
CHANGED
data/spec/aws_spec.rb
CHANGED
@@ -23,7 +23,7 @@ describe MovableInk::AWS do
|
|
23
23
|
it 'raises when AWS_REGION is not set and the metadata service is not available' do
|
24
24
|
miaws = MovableInk::AWS.new
|
25
25
|
# stub an error making a request to the metadata api
|
26
|
-
stub_request(:
|
26
|
+
stub_request(:put, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
|
27
27
|
expect { miaws.my_region }.to raise_error(MovableInk::AWS::Errors::MetadataTimeout)
|
28
28
|
end
|
29
29
|
end
|
data/spec/ec2_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe MovableInk::AWS::EC2 do
|
|
10
10
|
it "should raise an error if trying to load mi_env outside of EC2" do
|
11
11
|
aws = MovableInk::AWS.new
|
12
12
|
# stub an error making a request to the metadata api
|
13
|
-
stub_request(:
|
13
|
+
stub_request(:put, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
|
14
14
|
expect{ aws.mi_env }.to raise_error(MovableInk::AWS::Errors::MetadataTimeout)
|
15
15
|
end
|
16
16
|
|
@@ -22,7 +22,7 @@ describe MovableInk::AWS::EC2 do
|
|
22
22
|
it "should not find a 'me'" do
|
23
23
|
aws = MovableInk::AWS.new
|
24
24
|
# stub an error making a request to the metadata api
|
25
|
-
stub_request(:
|
25
|
+
stub_request(:put, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
|
26
26
|
expect(aws.me).to eq(nil)
|
27
27
|
end
|
28
28
|
end
|
data/spec/metadata_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe MovableInk::AWS::Metadata do
|
|
10
10
|
it 'should raise an error if the metadata service times out' do
|
11
11
|
aws = MovableInk::AWS.new
|
12
12
|
# stub an error making a request to the metadata api
|
13
|
-
stub_request(:
|
13
|
+
stub_request(:put, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
|
14
14
|
expect{ aws.instance_id }.to raise_error(MovableInk::AWS::Errors::MetadataTimeout)
|
15
15
|
expect{ aws.availability_zone }.to raise_error(MovableInk::AWS::Errors::MetadataTimeout)
|
16
16
|
end
|
@@ -18,7 +18,7 @@ describe MovableInk::AWS::Metadata do
|
|
18
18
|
it 'should raise an error if trying to load private_ipv4 outside of EC2' do
|
19
19
|
aws = MovableInk::AWS.new
|
20
20
|
# stub an error making a request to the metadata api
|
21
|
-
stub_request(:
|
21
|
+
stub_request(:put, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
|
22
22
|
expect{ aws.private_ipv4 }.to raise_error(MovableInk::AWS::Errors::MetadataTimeout)
|
23
23
|
end
|
24
24
|
end
|