vmware-vra 1.5.0 → 1.5.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
  SHA1:
3
- metadata.gz: 14871eed2bd85f0b933474eec52895806638ae1a
4
- data.tar.gz: 1bec5498c3cb3b1a7f2c7059283c4358ae551dbb
3
+ metadata.gz: d17754d67646cc908a208b43f89e826246abe5e0
4
+ data.tar.gz: ed6656668551bd9d45e14c013e987cc92e68c223
5
5
  SHA512:
6
- metadata.gz: 02d1b1adf9966b699145505b0088f29b69a9a66a4740c062ac237bd1d44fbeff72307ce07251e197df2d20540d3ef977335aca47068e0db0d1c82b23890bd16c
7
- data.tar.gz: bfefe81da01e572ef2b2bf9f11690c9c29227f65b6b3b5c8a40f929446350cda158876289003eff23bb0c9d722f258dfdd152e3321c875f71c75467f8028e89b
6
+ metadata.gz: 7d71707215098bd3f7a954568291d83326aea39965a40ed38e54405f267efd2179259fc0b450b6f6bc58945962b767a0e2fe1122d4fbd487eac56ee186413aac
7
+ data.tar.gz: ddc3b1fb76ee91442da096ed111ef2efc6cf291feb4d9cdf6a33212fded40d9a5af0a78e6e83d97ddadccd5be0aff59b8eed3980ec9d64ba1f7fc0b19670f5c3
@@ -0,0 +1,16 @@
1
+ language: ruby
2
+ cache: bundler
3
+ sudo: false
4
+ rvm:
5
+ - 2.0.0
6
+ - 2.1
7
+ - 2.2
8
+ branches:
9
+ only:
10
+ - master
11
+ notifications:
12
+ slack:
13
+ on_success: change
14
+ on_failure: always
15
+ rooms:
16
+ secure: SPX5JlKrlL3dpWUIRd/xxjId06D9OT7ig6qNlTH8bSoszw2t0QQ4X/m4iNmQ7ksMoqkvknc6y8HRVD7oJUgVYelBjZR+ayAdI+tlRvtU+CQdij+Xeamix3TwHgTWPzFmMoQl6zNkoLWRaXZ1DCRZi3/BPhXF0A9wGel4ToD6nBUe5chvvhWUltVFTxL0YmA537LWLqF+JyFWbr45Eo4EJXqo0i3Mz/1w1Ct7cDZjzIDsmPhchVYOdW1VA+rVC0oWiwGkx7KuX/QTs/D2XuL6xSRy/ftulgF+j/W8P3hgdjZaBlfm7UmEr/Df7nml8SXuo44hUB964EfLgTjg/EN8qYaZ9GhQ6xVuRuDGpoTc22kCUJqDWUFzlAbs/Og4qNP0FdZkofZPkvMG+C3JLwIKTDBNaG+DO+/19UZpcofPouQ5UOolFCkZcCwdMBHg2AecWFd4yMJ68giKd/zPdN/+ALxxK1RrOyk8JecvpolN/lhjnmR+zktJXaUikCzK3Zr2f2hXMVXULiGkMw5IRwiMor7nCIEBW5FqNP6mhV8JIDQguyLXy2wfCUBauhDR2VkV4pEFCCdRu+uPW8C80R1B3JmZn7q2KcX0WfsSoAntZh5ZedAXW+YoUKSnZR/X6RpxvRi/VSaX529BkyU07S52mS2xNW1HWgY2/laShHtMaAM=
@@ -1,5 +1,8 @@
1
1
  # vmware-vra-gem CHANGELOG
2
2
 
3
+ ## v1.5.1 (2016-03-11)
4
+ * [pr#19](https://github.com/chef-partners/vmware-vra-gem/pull/19) Treating a `MachineActivated` state as a machine in the process of being turned on. Fixes abnormal behavior in vRA 7.x.
5
+
3
6
  ## v1.5.0 (2015-11-18)
4
7
  * [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
8
 
@@ -0,0 +1,8 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+ require 'rubocop/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ RuboCop::RakeTask.new(:style)
7
+
8
+ task default: [ :spec, :style ]
@@ -26,12 +26,12 @@ module Vra
26
26
 
27
27
  def all_items
28
28
  client.http_get_paginated_array!('/catalog-service/api/consumer/catalogItems')
29
- .map! { |x| Vra::CatalogItem.new(client, data: x) }
29
+ .map! { |x| Vra::CatalogItem.new(client, data: x) }
30
30
  end
31
31
 
32
32
  def entitled_items
33
33
  client.http_get_paginated_array!('/catalog-service/api/consumer/entitledCatalogItems')
34
- .map! { |x| Vra::CatalogItem.new(client, data: x['catalogItem']) }
34
+ .map! { |x| Vra::CatalogItem.new(client, data: x['catalogItem']) }
35
35
  end
36
36
 
37
37
  def request(*args)
@@ -191,11 +191,11 @@ module Vra
191
191
  def raise_http_exception(caught_exception, path)
192
192
  raise unless caught_exception.respond_to?(:http_code)
193
193
 
194
- if caught_exception.http_code == 404
195
- klass = Vra::Exception::HTTPNotFound
196
- else
197
- klass = Vra::Exception::HTTPError
198
- end
194
+ klass = if caught_exception.http_code == 404
195
+ Vra::Exception::HTTPNotFound
196
+ else
197
+ Vra::Exception::HTTPError
198
+ end
199
199
 
200
200
  exception = klass.new(code: caught_exception.http_code,
201
201
  body: caught_exception.response,
@@ -49,7 +49,7 @@ module Vra
49
49
  rescue Vra::Exception::HTTPNotFound
50
50
  raise Vra::Exception::NotFound, "resource ID #{@id} does not exist"
51
51
  end
52
- alias_method :refresh, :fetch_resource_data
52
+ alias refresh fetch_resource_data
53
53
 
54
54
  def name
55
55
  resource_data['name']
@@ -115,7 +115,7 @@ module Vra
115
115
  end
116
116
 
117
117
  def machine_turning_on?
118
- machine_status == 'TurningOn'
118
+ machine_status == 'TurningOn' || machine_status == 'MachineActivated'
119
119
  end
120
120
 
121
121
  def machine_turning_off?
@@ -17,5 +17,5 @@
17
17
  #
18
18
 
19
19
  module Vra
20
- VERSION = '1.5.0'
20
+ VERSION = '1.5.1'.freeze
21
21
  end
@@ -245,6 +245,11 @@ describe Vra::Resource do
245
245
  expect(resource.machine_turning_on?).to eq(true)
246
246
  end
247
247
 
248
+ it 'returns true if the machine_status is MachineActivated' do
249
+ allow(resource).to receive(:machine_status).and_return('MachineActivated')
250
+ expect(resource.machine_turning_on?).to eq(true)
251
+ end
252
+
248
253
  it 'returns false if the machine_status is not TurningOn' do
249
254
  allow(resource).to receive(:machine_status).and_return('On')
250
255
  expect(resource.machine_turning_on?).to eq(false)
@@ -26,5 +26,6 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'rake', '~> 10.0'
27
27
  spec.add_development_dependency 'rspec', '~> 3.0'
28
28
  spec.add_development_dependency 'webmock', '~> 1.21'
29
+ spec.add_development_dependency 'rubocop', '~> 0.35'
29
30
  spec.add_development_dependency 'pry', '~> 0.10'
30
31
  end
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.5.0
4
+ version: 1.5.1
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-18 00:00:00.000000000 Z
11
+ date: 2016-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.21'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.35'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.35'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: pry
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -131,10 +145,12 @@ extra_rdoc_files: []
131
145
  files:
132
146
  - ".gitignore"
133
147
  - ".rubocop.yml"
148
+ - ".travis.yml"
134
149
  - CHANGELOG.md
135
150
  - Gemfile
136
151
  - LICENSE.txt
137
152
  - README.md
153
+ - Rakefile
138
154
  - lib/vra.rb
139
155
  - lib/vra/catalog.rb
140
156
  - lib/vra/catalog_item.rb
@@ -197,4 +213,3 @@ test_files:
197
213
  - spec/resource_spec.rb
198
214
  - spec/resources_spec.rb
199
215
  - spec/spec_helper.rb
200
- has_rdoc: