specinfra-ec2_metadata-tags 0.0.3 → 0.0.4
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: 8e53aead9bd04131d0842dff3be8e9971b056117
|
4
|
+
data.tar.gz: 7f456eed5e0d78505486bee20339e7ed878ecbe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5bb4fb3ad700d8948f919646068b6bbd3bd5c0a4356fbcb2300626c4f350caea10f60db6fb831bf22adfcde8b3b786a8c8998b27c9bae128a512d2ddbc90dc8
|
7
|
+
data.tar.gz: 328f2b686bba745ea598f28663b11381caf500fe5c2a64ce142f42a69399ff521ce1b3cbe49cbefa513649a5cc1b8d4dbc0664c75a0f688efb5a15e93efc6a3f
|
@@ -4,13 +4,17 @@ require 'aws-sdk'
|
|
4
4
|
module Specinfra
|
5
5
|
class Ec2Metadata
|
6
6
|
class Tags
|
7
|
-
def
|
8
|
-
|
7
|
+
def initialize(host_inventory)
|
8
|
+
@host_inventory = host_inventory
|
9
|
+
end
|
10
|
+
|
11
|
+
def get
|
12
|
+
region = @host_inventory['ec2']['placement']['availability-zone'].gsub(/[a-z]$/, '')
|
9
13
|
ec2 = Aws::EC2::Client.new(:region => region)
|
10
14
|
page = ec2.describe_tags(
|
11
15
|
:filters => [{
|
12
16
|
:name => 'resource-id',
|
13
|
-
:values => [ host_inventory['ec2']['instance-id'] ],
|
17
|
+
:values => [ @host_inventory['ec2']['instance-id'] ],
|
14
18
|
}]
|
15
19
|
)
|
16
20
|
tags = {}
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_runtime_dependency "aws-sdk", "~> 2"
|
22
|
-
spec.add_runtime_dependency "specinfra", "~> 2.
|
22
|
+
spec.add_runtime_dependency "specinfra", "~> 2.24"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.7"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specinfra-ec2_metadata-tags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '2.
|
33
|
+
version: '2.24'
|
34
34
|
type: :runtime
|
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: '2.
|
40
|
+
version: '2.24'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|