vrt-ec2-tags 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 27702ee645463df7181c266d3ae8babd5f123a6da2c3c21b0ef4ab939d1650d4
4
- data.tar.gz: 17929edc5a708addaadb8a1cb6bdbb11462a642f75bfe975c18a531681d1dcd9
3
+ metadata.gz: de8eaa54e9adecce14c0f5a070dd1eaadbc7bad6e219073fcc5ac981c754dd83
4
+ data.tar.gz: b870a833adede95242143d7dd4f56af87d4d5bc173b243e85d599c428ea4e005
5
5
  SHA512:
6
- metadata.gz: 945ab937edf04515b2921a0309d6e9da7c19bde25bd68c3b6a9ef8ab58f59d3c9f1deef1c571c197e7f6c133931a8c8e26d98774867746c17c88b3b8070d8757
7
- data.tar.gz: 31efd9083ca6499ee09f889f1e6170d17091d7fd85a798317b0baf5a33c552016e9b7bdfb065d40d1e76d2a387e20a8d07c5f3d4ef24431e8ad1b1e75e326320
6
+ metadata.gz: 9996a961059bba1cd6d81189e671173bb7c42a8fa146c45e44ccf4c0a76d9071f52e09154a3324f02a339d57a280ced2bf97888700dffd898617932544cd100d
7
+ data.tar.gz: fdb17723e89deae2a5a7aaad460af22e5a7fbae41b0c65993314a27e198e3c1bc344c530488afe890f3aeed133899e5ceb03becaddc99636b06847e5c93b0aca
data/.gitignore CHANGED
@@ -11,3 +11,5 @@
11
11
  .rspec_status
12
12
 
13
13
  /vendor
14
+
15
+ Gemfile.lock
@@ -25,6 +25,20 @@ module Vrt
25
25
  end
26
26
 
27
27
  def self.read_tags
28
+ response = request_tags
29
+ case response
30
+ when Net::HTTPSuccess
31
+ response.body
32
+ when Net::HTTPUnauthorized
33
+ raise("#{response.message}: username and password set and correct?")
34
+ when Net::HTTPServerError
35
+ raise("#{response.message}: try again later?")
36
+ else
37
+ raise(response.message)
38
+ end
39
+ end
40
+
41
+ def self.request_tags
28
42
  http = Net::HTTP.new(tag_uri.host, tag_uri.port)
29
43
  http.use_ssl = true
30
44
  http.open_timeout = 2
@@ -33,8 +47,7 @@ module Vrt
33
47
  request = Net::HTTP::Post.new(tag_uri)
34
48
  request.add_field 'Content-Type', 'text/plain; charset=utf-8'
35
49
  request.body = instance_id
36
- response = http.request(request)
37
- response.body if response.is_a? Net::HTTPSuccess
50
+ http.request(request)
38
51
  end
39
52
 
40
53
  def self.instance_id
@@ -3,7 +3,7 @@
3
3
  module Vrt
4
4
  module Ec2
5
5
  module Tags
6
- VERSION = '0.1.0'
6
+ VERSION = '0.1.1'
7
7
  end
8
8
  end
9
9
  end
@@ -28,8 +28,8 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ['lib']
29
29
 
30
30
  spec.add_development_dependency 'awesome_print'
31
- spec.add_development_dependency 'bundler', '~> 1.16'
32
- spec.add_development_dependency 'rake', '~> 10.0'
33
- spec.add_development_dependency 'rspec', '~> 3.0'
34
- spec.add_development_dependency 'rubocop', '~> 0.52.0'
31
+ spec.add_development_dependency 'bundler'
32
+ spec.add_development_dependency 'rake'
33
+ spec.add_development_dependency 'rspec'
34
+ spec.add_development_dependency 'rubocop'
35
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vrt-ec2-tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan - Zipkid - Goethals
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-17 00:00:00.000000000 Z
11
+ date: 2020-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -28,58 +28,58 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.16'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.16'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '3.0'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '3.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubocop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.52.0
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.52.0
82
+ version: '0'
83
83
  description: Fetch EC2 tags for the requesting host only via Lambda
84
84
  email:
85
85
  - stefan.goehals@vrt.be
@@ -92,7 +92,6 @@ files:
92
92
  - ".rspec"
93
93
  - ".rubocop.yml"
94
94
  - Gemfile
95
- - Gemfile.lock
96
95
  - README.md
97
96
  - Rakefile
98
97
  - bin/console
@@ -120,8 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
119
  - !ruby/object:Gem::Version
121
120
  version: '0'
122
121
  requirements: []
123
- rubyforge_project:
124
- rubygems_version: 2.7.6
122
+ rubygems_version: 3.0.6
125
123
  signing_key:
126
124
  specification_version: 4
127
125
  summary: Fetch EC2 tags for the requesting host only via Lambda
@@ -1,53 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- vrt-ec2-tags (0.1.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- ast (2.4.0)
10
- awesome_print (1.8.0)
11
- diff-lcs (1.3)
12
- parallel (1.12.1)
13
- parser (2.5.3.0)
14
- ast (~> 2.4.0)
15
- powerpack (0.1.2)
16
- rainbow (3.0.0)
17
- rake (10.5.0)
18
- rspec (3.8.0)
19
- rspec-core (~> 3.8.0)
20
- rspec-expectations (~> 3.8.0)
21
- rspec-mocks (~> 3.8.0)
22
- rspec-core (3.8.0)
23
- rspec-support (~> 3.8.0)
24
- rspec-expectations (3.8.2)
25
- diff-lcs (>= 1.2.0, < 2.0)
26
- rspec-support (~> 3.8.0)
27
- rspec-mocks (3.8.0)
28
- diff-lcs (>= 1.2.0, < 2.0)
29
- rspec-support (~> 3.8.0)
30
- rspec-support (3.8.0)
31
- rubocop (0.52.1)
32
- parallel (~> 1.10)
33
- parser (>= 2.4.0.2, < 3.0)
34
- powerpack (~> 0.1)
35
- rainbow (>= 2.2.2, < 4.0)
36
- ruby-progressbar (~> 1.7)
37
- unicode-display_width (~> 1.0, >= 1.0.1)
38
- ruby-progressbar (1.10.0)
39
- unicode-display_width (1.4.0)
40
-
41
- PLATFORMS
42
- ruby
43
-
44
- DEPENDENCIES
45
- awesome_print
46
- bundler (~> 1.16)
47
- rake (~> 10.0)
48
- rspec (~> 3.0)
49
- rubocop (~> 0.52.0)
50
- vrt-ec2-tags!
51
-
52
- BUNDLED WITH
53
- 1.16.1