manageiq-smartstate 0.3.0 → 0.3.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: 4f731538916cc77ead512682c9f59f0973df895c
4
- data.tar.gz: c749c7daf28c1e65ae613bfe632ff8c98ba1a0eb
3
+ metadata.gz: 5f43ae766750f3806637203402e8854fc3a04ecd
4
+ data.tar.gz: d095b81850e3ac86139c57abf2ded99987a175b8
5
5
  SHA512:
6
- metadata.gz: b28438c09564c8d3e44cfda1a7c263847578274d231c8ca5423d7e44622cb8cd5b10dedbaa8ef0c2109f0212f6e47a5ff7aa793f687a9d50e23f9feeae1959f1
7
- data.tar.gz: 2e55c1e754a8adc088be23da2ca5c0d7b07dffd9ed0a93f39ef41aa904de1f46a5d271a45f406b62399e2752f55fc60e7475435153cb416ace39cdd79bb4bb77
6
+ metadata.gz: dab2eb64ac72a70bf8cad523f23a19fff4866664965cbb4430f2156005bebbdd7b2958a9e604652a9f4146591a8414350db070384664ccc8f7e3d3f733492b3d
7
+ data.tar.gz: e98c541ba547c02da75752fe66bfd099f54615159a3cefaba881ef4e485237d20892e1bcd097688b0f5d7be619ad7d0d826cb375bfb4ed9adef77bcd4ba32576
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module Smartstate
3
- VERSION = "0.3.0".freeze
3
+ VERSION = "0.3.1".freeze
4
4
  end
5
5
  end
@@ -478,10 +478,15 @@ class VmConfig
478
478
  end
479
479
  elsif miqvm.rhevm
480
480
  # First add the VM's active disk files.
481
- miqvm.rhevmVm.disks.each { |disk| @files << rhevm_disk_file_entry(disk) }
481
+ disks = miqvm.rhevm.collect_vm_disks(miqvm.rhevmVm)
482
+ disks.each { |disk| @files << rhevm_disk_file_entry(disk) }
482
483
  # Then add the files associtaed with inactive snapshots.
483
- miqvm.rhevmVm.snapshots.each do |snap|
484
- snap.disks.each { |disk| @files << rhevm_disk_file_entry(disk) unless snap[:type] == 'active' }
484
+ miqvm.rhevm.collect_snapshots(miqvm.rhevmVm).each do |snap|
485
+ next if snap.snapshot_type == 'active'
486
+
487
+ miqvm.rhevm.collect_disks_of_snapshot(snap).each do |disk|
488
+ @files << rhevm_disk_file_entry(disk)
489
+ end
485
490
  end
486
491
  end
487
492
  rescue => err
@@ -493,12 +498,10 @@ class VmConfig
493
498
  end
494
499
 
495
500
  def rhevm_disk_file_entry(disk)
496
- storage_domain = disk[:storage_domains].first
497
- storage_id = storage_domain && storage_domain[:id]
498
- disk_key = disk[:image_id].blank? ? :id : :image_id
499
- fullPath = storage_id && File.join('/dev', storage_id, disk[disk_key])
500
-
501
- {:path => fullPath, :name => disk[disk_key], :size => disk[:actual_size].to_i}
501
+ storage_id = disk.storage_domains.first&.id
502
+ disk_id = disk.image_id || disk.id
503
+ full_path = storage_id && File.join('/dev', storage_id, disk_id)
504
+ {:path => full_path, :name => disk_id, :size => disk.actual_size.to_i}
502
505
  end
503
506
  private :rhevm_disk_file_entry
504
507
 
@@ -545,12 +548,12 @@ class VmConfig
545
548
  end
546
549
  end
547
550
  elsif miqvm.rhevmVm
548
- miqvm.rhevmVm.disks.each do |disk|
549
- storage_domain = disk[:storage_domains].first
550
- storage_id = storage_domain && storage_domain[:id]
551
- disk_key = disk[:image_id].blank? ? :id : :image_id
552
- fullPath = storage_id && File.join('/dev', storage_id, disk[disk_key])
553
- d = {:path => fullPath, :name => disk[:name].to_s, :size => disk[:size].to_i}
551
+ disks = miqvm.rhevm.collect_vm_disks(miqvm.rhevmVm)
552
+ disks.each do |disk|
553
+ storage_id = disk.storage_domains.first&.id
554
+ disk_id = disk.image_id || disk.id
555
+ full_path = storage_id && File.join('/dev', storage_id, disk_id)
556
+ d = {:path => full_path, :name => disk.name.to_s, :size => disk.actual_size.to_i}
554
557
  @disk_files << d
555
558
  end
556
559
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-smartstate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-08 00:00:00.000000000 Z
11
+ date: 2019-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure-armrest