awspec 0.56.1 → 0.57.0

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: 761b06f2753d247a1d7e9d472fd8e02b028fe403
4
- data.tar.gz: 38329c670345d3563c6af1910f9b039e92c809ad
3
+ metadata.gz: e9b6decea26578d2bf10057ea7543f0b5674b23a
4
+ data.tar.gz: c85b5938ef1aeda87ec4d2cab4fc2fe58c31c29b
5
5
  SHA512:
6
- metadata.gz: 3c1b621ec8438f7df924cc61ebb9f25febea68cee4a1e340bea28744b790efed48daf9a62fe01a8c6885ebaf6214cd8554d6c5aa0caddd428e4688ca383aed4a
7
- data.tar.gz: 804fa724043cc0d32660b24f7893a1f1e959065b07886cf1478fa000568cce69fa806a6fdbc42348915f8a435e2b0fc7b9ac26218bae81123b579dfed3fda658
6
+ metadata.gz: 6e696e44e8e93edfef0c992aa366ba7ad4e83b35ff070f38e3548393ef3da590cfeb7a425abb88d250156d062c7922a38b77c94cab101b8802e2f4df05a122db
7
+ data.tar.gz: abc15b38d60d7bbf54a6b1bf7cf0446823beadef3ea8c2d204fa5a0c4915f199ecb81d67bdd1a1dad1e96b96b6046c6d28f853b99011ea8cdf8dec69ba2156d3
@@ -41,6 +41,14 @@ describe network_interface('eni-12ab3cde') do
41
41
  end
42
42
  ```
43
43
 
44
+ ### have_tag
45
+
46
+ ```ruby
47
+ describe network_interface('eni-12ab3cde') do
48
+ it { should have_tag('Name').value('my-eni') }
49
+ end
50
+ ```
51
+
44
52
  ### belong_to_subnet
45
53
 
46
54
  ```ruby
@@ -1202,6 +1202,15 @@ end
1202
1202
  ```
1203
1203
 
1204
1204
 
1205
+ ### have_tag
1206
+
1207
+ ```ruby
1208
+ describe network_interface('eni-12ab3cde') do
1209
+ it { should have_tag('Name').value('my-eni') }
1210
+ end
1211
+ ```
1212
+
1213
+
1205
1214
  ### belong_to_subnet
1206
1215
 
1207
1216
  ```ruby
@@ -65,6 +65,11 @@ module Awspec::Helper
65
65
  }
66
66
  ]
67
67
  })
68
+ resource = res.network_interfaces.single_resource(interface_id)
69
+ return resource if resource
70
+ res = ec2_client.describe_network_interfaces({
71
+ filters: [{ name: 'tag:Name', values: [interface_id] }]
72
+ })
68
73
  res.network_interfaces.single_resource(interface_id)
69
74
  end
70
75
 
@@ -33,7 +33,12 @@ Aws.config[:ec2] = {
33
33
  delete_on_termination: true
34
34
  },
35
35
  association: nil,
36
- tag_set: [],
36
+ tag_set: [
37
+ {
38
+ key: 'Name',
39
+ value: 'my-eni'
40
+ }
41
+ ],
37
42
  private_ip_addresses: [
38
43
  {
39
44
  private_ip_address: '10.0.1.1',
@@ -43,7 +43,11 @@ module Awspec::Type
43
43
 
44
44
  def self.tags_allowed
45
45
  define_method :has_tag? do |key, value|
46
- tags = resource_via_client.tags
46
+ begin
47
+ tags = resource_via_client.tags
48
+ rescue NoMethodError
49
+ tags = resource_via_client.tag_set
50
+ end
47
51
  return false unless tags
48
52
  tags.any? { |t| t['key'] == key && t['value'] == value }
49
53
  end
@@ -1,5 +1,7 @@
1
1
  module Awspec::Type
2
2
  class NetworkInterface < Base
3
+ tags_allowed
4
+
3
5
  def resource_via_client
4
6
  @resource_via_client ||= find_network_interface(@display_name)
5
7
  end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.56.1'
2
+ VERSION = '0.57.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.56.1
4
+ version: 0.57.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-08 00:00:00.000000000 Z
11
+ date: 2016-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec