fog-vsphere 1.5.2 → 1.6.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: fc6ccb1f44c8afade6e70efc449d05184c446f52
4
- data.tar.gz: 39d5496413d90ce5b393e43e110f03f87565c07e
3
+ metadata.gz: ed406936e8160692fc51175c72c9011fecd95653
4
+ data.tar.gz: 7f184ce06c1b43431c84da12d2880589d570d724
5
5
  SHA512:
6
- metadata.gz: b638f779c9567d64812575781c204ca1c5ae6b7c2efff64520383c09f67941661f8f70dff3ce4feb59718f83c972cb4ac69d8d26de1c139dd08734342a8ff204
7
- data.tar.gz: 8dd2017c1de9dc207c280b02c0d768d757cfc29db69e9627392e61433788e7aa29946f1cad921d8b05225b18b7615422d5268adbc7bbb9b56634d51df7c1be3b
6
+ metadata.gz: 7c3892e6447634c9cb464ac7fd9aae19ef12c7583a0fa6f598a66055e6aee66007e4dfa44e8859b417da0cdf3b1ec71f732196e6bff2b0de3d20d4a9e5149410
7
+ data.tar.gz: 8f99da266df8a4aa7182d383601562664fa26a3c50a2dfbad5cb2b4479ade1a3f2e3756d7d4db13172421cf5210ee0e7b12dbb06b961203ffae407f110dc6c1f
@@ -1,3 +1,7 @@
1
+ ## v1.6.0
2
+
3
+ * Support updating of server CPUs and memory
4
+
1
5
  ## v1.5.2
2
6
 
3
7
  * Handle vSphere VMs being created or removed when searching for VM
@@ -272,11 +272,12 @@ module Fog
272
272
  def save
273
273
  requires :name, :cluster, :datacenter
274
274
  if persisted?
275
- raise "update is not supported yet"
276
- # service.update_vm(attributes)
275
+ vm_reconfig_cpus if attribute_changed?(:cpus) || attribute_changed?(:corespersocket)
276
+ vm_reconfig_memory if attribute_changed?(:memory_mb)
277
277
  else
278
278
  self.id = service.create_vm(attributes)
279
279
  end
280
+ @old = nil
280
281
  reload
281
282
  end
282
283
 
@@ -344,6 +345,14 @@ module Fog
344
345
  ]
345
346
  end
346
347
  end
348
+
349
+ def attribute_changed?(attr)
350
+ self.attributes.select { |k, v| old.attributes[k] != v }.key?(attr)
351
+ end
352
+
353
+ def old
354
+ @old ||= self.dup.reload
355
+ end
347
356
  end
348
357
  end
349
358
  end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Vsphere
3
- VERSION = '1.5.2'
3
+ VERSION = '1.6.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - J.R. Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-29 00:00:00.000000000 Z
11
+ date: 2016-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core