vmware-vra 1.4.0 → 1.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc9e9d7665729a03331b9df0eb593c0eac98cd4f
4
- data.tar.gz: 051f3872d7e61a010c9a7f3df03a7fd100f66f13
3
+ metadata.gz: 14871eed2bd85f0b933474eec52895806638ae1a
4
+ data.tar.gz: 1bec5498c3cb3b1a7f2c7059283c4358ae551dbb
5
5
  SHA512:
6
- metadata.gz: 0fb315d6bfcfa59ecd74223d01c072e280998b052e39fde2ed3c5db0733ec092db4b11df841850c65b9c6d55126be3699d2ce5a877c52db21f771419245e024f
7
- data.tar.gz: e1fb180fe23fe5ccc520b2e8b18c7afe2d01c9a67f2acfd3557514f2ed80e19b2854000e5bcc3ff11392085a919bc268d90818344feee48c35a1d80878d46fb1
6
+ metadata.gz: 02d1b1adf9966b699145505b0088f29b69a9a66a4740c062ac237bd1d44fbeff72307ce07251e197df2d20540d3ef977335aca47068e0db0d1c82b23890bd16c
7
+ data.tar.gz: bfefe81da01e572ef2b2bf9f11690c9c29227f65b6b3b5c8a40f929446350cda158876289003eff23bb0c9d722f258dfdd152e3321c875f71c75467f8028e89b
@@ -1,3 +1,8 @@
1
+ # vmware-vra-gem CHANGELOG
2
+
3
+ ## v1.5.0 (2015-11-18)
4
+ * [pr#15](https://github.com/chef-partners/vmware-vra-gem/pull/15) Adding support for Infrastructure.Cloud resources, such as EC2 resources created by vRA catalog items
5
+
1
6
  ## v1.4.0
2
7
  * [pr#14](https://github.com/chef-partners/vmware-vra-gem/pull/14) Adding appropriate methods for managing the bearer_token
3
8
 
@@ -64,7 +64,7 @@ module Vra
64
64
  end
65
65
 
66
66
  def vm?
67
- resource_data['resourceTypeRef']['id'] == 'Infrastructure.Virtual'
67
+ %w(Infrastructure.Virtual Infrastructure.Cloud).include?(resource_data['resourceTypeRef']['id'])
68
68
  end
69
69
 
70
70
  def tenant_id
@@ -17,5 +17,5 @@
17
17
  #
18
18
 
19
19
  module Vra
20
- VERSION = '1.4.0'
20
+ VERSION = '1.5.0'
21
21
  end
@@ -123,8 +123,28 @@ describe Vra::Resource do
123
123
  end
124
124
 
125
125
  describe '#vm?' do
126
- it 'returns true for the VM resource we created' do
127
- expect(resource.vm?).to be true
126
+ context 'when the resource type is Infrastructure.Virtual' do
127
+ let(:resource_data) { { 'resourceTypeRef' => { 'id' => 'Infrastructure.Virtual' } } }
128
+ it 'returns true' do
129
+ allow(resource).to receive(:resource_data).and_return(resource_data)
130
+ expect(resource.vm?).to eq(true)
131
+ end
132
+ end
133
+
134
+ context 'when the resource type is Infrastructure.Cloud' do
135
+ let(:resource_data) { { 'resourceTypeRef' => { 'id' => 'Infrastructure.Cloud' } } }
136
+ it 'returns true' do
137
+ allow(resource).to receive(:resource_data).and_return(resource_data)
138
+ expect(resource.vm?).to eq(true)
139
+ end
140
+ end
141
+
142
+ context 'when the resource type is an unknown type' do
143
+ let(:resource_data) { { 'resourceTypeRef' => { 'id' => 'Infrastructure.Unknown' } } }
144
+ it 'returns false' do
145
+ allow(resource).to receive(:resource_data).and_return(resource_data)
146
+ expect(resource.vm?).to eq(false)
147
+ end
128
148
  end
129
149
  end
130
150
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmware-vra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Leff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-13 00:00:00.000000000 Z
11
+ date: 2015-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client