manageiq-smartstate 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +3 -2
  3. data/lib/manageiq/smartstate/version.rb +1 -1
  4. data/manageiq-smartstate.gemspec +1 -1
  5. metadata +3 -42
  6. data/lib/MiqVm/test/camcorder_fleece_test.rb +0 -52
  7. data/lib/MiqVm/test/localVm.rb +0 -38
  8. data/lib/MiqVm/test/partitionAlignmentCheck.rb +0 -67
  9. data/lib/MiqVm/test/remoteVm.rb +0 -56
  10. data/lib/MiqVm/test/rhevmNfsTest.rb +0 -54
  11. data/lib/MiqVm/test/rhevmNfsTest2.rb +0 -58
  12. data/lib/MiqVm/test/rhevmTest.rb +0 -62
  13. data/lib/Scvmm/test/miq_hyperv_disk_test.rb +0 -23
  14. data/lib/Scvmm/test/miq_scvmm_vm_ssa_info_test.rb +0 -31
  15. data/lib/VmLocalDiskAccess/test/localCfg.rb +0 -87
  16. data/lib/VolumeManager/test/blockDevTest.rb +0 -32
  17. data/lib/VolumeManager/test/ldm.rb +0 -90
  18. data/lib/fs/MetakitFS/test/Makefile +0 -14
  19. data/lib/fs/MetakitFS/test/MkCollectFiles.rb +0 -165
  20. data/lib/fs/MetakitFS/test/MkSelectFiles.rb +0 -20
  21. data/lib/fs/MetakitFS/test/collect_files.yaml +0 -70
  22. data/lib/fs/MetakitFS/test/init.rb +0 -3
  23. data/lib/fs/MetakitFS/test/mk2vmdk.rb +0 -54
  24. data/lib/fs/MetakitFS/test/mk4test.c +0 -92
  25. data/lib/fs/MetakitFS/test/mkFsTest.rb +0 -113
  26. data/lib/fs/MetakitFS/test/proto.rb +0 -97
  27. data/lib/fs/ext3/test/tc_Ext3BlockPointersPath.rb +0 -74
  28. data/lib/fs/test/camcorder_fs_test.rb +0 -98
  29. data/lib/fs/test/collect_files_direct.yaml +0 -22
  30. data/lib/fs/test/collect_files_in.yaml +0 -24
  31. data/lib/fs/test/collect_files_in_nc.yaml +0 -22
  32. data/lib/fs/test/collect_files_out.yaml +0 -6
  33. data/lib/fs/test/collect_files_rm.yaml +0 -6
  34. data/lib/fs/test/copyTest.rb +0 -116
  35. data/lib/fs/test/fsTest.rb +0 -77
  36. data/lib/fs/test/updateTest.rb +0 -174
  37. data/lib/metadata/MIQExtract/test/extractTest.rb +0 -33
  38. data/lib/metadata/MIQExtract/test/full_extract_test.rb +0 -67
  39. data/lib/metadata/VmConfig/test/GetVMwareCfgTest.rb +0 -40
  40. data/lib/metadata/linux/test/Name +0 -0
  41. data/lib/metadata/linux/test/Packages +0 -0
  42. data/lib/metadata/linux/test/rpoTest.rb +0 -5
  43. data/lib/metadata/linux/test/tc_LinuxUtils.rb +0 -4157
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5f43ae766750f3806637203402e8854fc3a04ecd
4
- data.tar.gz: d095b81850e3ac86139c57abf2ded99987a175b8
2
+ SHA256:
3
+ metadata.gz: c9aeecaa1ea2d886cca76d62516f06ed1376fb04df6f14534d14dba79b5e36c9
4
+ data.tar.gz: 37c03eaae437868d213062120b5ca8c59b64dfa5e976e868426a628237b96596
5
5
  SHA512:
6
- metadata.gz: dab2eb64ac72a70bf8cad523f23a19fff4866664965cbb4430f2156005bebbdd7b2958a9e604652a9f4146591a8414350db070384664ccc8f7e3d3f733492b3d
7
- data.tar.gz: e98c541ba547c02da75752fe66bfd099f54615159a3cefaba881ef4e485237d20892e1bcd097688b0f5d7be619ad7d0d826cb375bfb4ed9adef77bcd4ba32576
6
+ metadata.gz: e688b0a92499d7b28c2c2fc23c8731dad80da3a8ebecd0812005996374656e55cd62b5630b147c61462e58cfbc060b783b952de7c934a36964c9225e30afaee1
7
+ data.tar.gz: 8c740ee7250f6826861270028dde496e80dbabd93b710f61ff5e6fbe03a5a98cf0882b1e03c33a23f86bcebf734f449c031a02a9ffe02a84767fca5506613012
data/.travis.yml CHANGED
@@ -1,9 +1,10 @@
1
+ ---
1
2
  sudo: false
2
3
  cache: bundler
3
4
  language: ruby
4
5
  rvm:
5
- - 2.4.5
6
- - 2.5.3
6
+ - 2.5.7
7
+ - 2.6.5
7
8
  after_script: bundle exec codeclimate-test-reporter
8
9
  notifications:
9
10
  webhooks:
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module Smartstate
3
- VERSION = "0.3.1".freeze
3
+ VERSION = "0.3.2".freeze
4
4
  end
5
5
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.license = "Apache-2.0"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
- f.match(%r{^(test|spec|features)/})
17
+ f.match(%r{^(spec|features)/|test/})
18
18
  end
19
19
  spec.bindir = "exe"
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
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.1
4
+ version: 0.3.2
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-09-03 00:00:00.000000000 Z
11
+ date: 2019-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure-armrest
@@ -288,22 +288,12 @@ files:
288
288
  - lib/MiqVm/MiqVm.rb
289
289
  - lib/MiqVm/miq_azure_vm.rb
290
290
  - lib/MiqVm/miq_scvmm_vm.rb
291
- - lib/MiqVm/test/camcorder_fleece_test.rb
292
- - lib/MiqVm/test/localVm.rb
293
- - lib/MiqVm/test/partitionAlignmentCheck.rb
294
- - lib/MiqVm/test/remoteVm.rb
295
- - lib/MiqVm/test/rhevmNfsTest.rb
296
- - lib/MiqVm/test/rhevmNfsTest2.rb
297
- - lib/MiqVm/test/rhevmTest.rb
298
291
  - lib/OpenStackExtract/MiqOpenStackVm/MiqOpenStackCommon.rb
299
292
  - lib/OpenStackExtract/MiqOpenStackVm/MiqOpenStackImage.rb
300
293
  - lib/OpenStackExtract/MiqOpenStackVm/MiqOpenStackInstance.rb
301
294
  - lib/Scvmm/miq_hyperv_disk.rb
302
295
  - lib/Scvmm/miq_scvmm_parse_powershell.rb
303
296
  - lib/Scvmm/miq_scvmm_vm_ssa_info.rb
304
- - lib/Scvmm/test/miq_hyperv_disk_test.rb
305
- - lib/Scvmm/test/miq_scvmm_vm_ssa_info_test.rb
306
- - lib/VmLocalDiskAccess/test/localCfg.rb
307
297
  - lib/VolumeManager/LVM.rb
308
298
  - lib/VolumeManager/LVM/logical_volume.rb
309
299
  - lib/VolumeManager/LVM/lv_segment.rb
@@ -325,8 +315,6 @@ files:
325
315
  - lib/VolumeManager/MiqVolumeManager.rb
326
316
  - lib/VolumeManager/VolMgrPlatformSupport.rb
327
317
  - lib/VolumeManager/VolMgrPlatformSupportLinux.rb
328
- - lib/VolumeManager/test/blockDevTest.rb
329
- - lib/VolumeManager/test/ldm.rb
330
318
  - lib/blackbox/VmBlackBox.rb
331
319
  - lib/blackbox/xmlStorage.rb
332
320
  - lib/db/MiqBdb/MiqBdb.rb
@@ -375,15 +363,6 @@ files:
375
363
  - lib/disk/modules/vhdx_bat_entry.rb
376
364
  - lib/disk/test.rb
377
365
  - lib/fs/MetakitFS/MetakitFS.rb
378
- - lib/fs/MetakitFS/test/Makefile
379
- - lib/fs/MetakitFS/test/MkCollectFiles.rb
380
- - lib/fs/MetakitFS/test/MkSelectFiles.rb
381
- - lib/fs/MetakitFS/test/collect_files.yaml
382
- - lib/fs/MetakitFS/test/init.rb
383
- - lib/fs/MetakitFS/test/mk2vmdk.rb
384
- - lib/fs/MetakitFS/test/mk4test.c
385
- - lib/fs/MetakitFS/test/mkFsTest.rb
386
- - lib/fs/MetakitFS/test/proto.rb
387
366
  - lib/fs/MiqFS/FsProbe.rb
388
367
  - lib/fs/MiqFS/MiqFS.rb
389
368
  - lib/fs/MiqFS/modules/AUFSProbe.rb
@@ -440,7 +419,6 @@ files:
440
419
  - lib/fs/ext3/posix_acl_entry.rb
441
420
  - lib/fs/ext3/posix_acl_header.rb
442
421
  - lib/fs/ext3/superblock.rb
443
- - lib/fs/ext3/test/tc_Ext3BlockPointersPath.rb
444
422
  - lib/fs/ext4/alloc_bitmap.rb
445
423
  - lib/fs/ext4/directory.rb
446
424
  - lib/fs/ext4/directory_entry.rb
@@ -490,15 +468,6 @@ files:
490
468
  - lib/fs/ntfs/index_record_header.rb
491
469
  - lib/fs/ntfs/mft_entry.rb
492
470
  - lib/fs/ntfs/utils.rb
493
- - lib/fs/test/camcorder_fs_test.rb
494
- - lib/fs/test/collect_files_direct.yaml
495
- - lib/fs/test/collect_files_in.yaml
496
- - lib/fs/test/collect_files_in_nc.yaml
497
- - lib/fs/test/collect_files_out.yaml
498
- - lib/fs/test/collect_files_rm.yaml
499
- - lib/fs/test/copyTest.rb
500
- - lib/fs/test/fsTest.rb
501
- - lib/fs/test/updateTest.rb
502
471
  - lib/fs/xfs/allocation_group.rb
503
472
  - lib/fs/xfs/bmap_btree_block.rb
504
473
  - lib/fs/xfs/bmap_btree_record.rb
@@ -520,8 +489,6 @@ files:
520
489
  - lib/manageiq/smartstate/util.rb
521
490
  - lib/manageiq/smartstate/version.rb
522
491
  - lib/metadata/MIQExtract/MIQExtract.rb
523
- - lib/metadata/MIQExtract/test/extractTest.rb
524
- - lib/metadata/MIQExtract/test/full_extract_test.rb
525
492
  - lib/metadata/ScanProfile/HostScanItem.rb
526
493
  - lib/metadata/ScanProfile/HostScanProfile.rb
527
494
  - lib/metadata/ScanProfile/HostScanProfiles.rb
@@ -543,7 +510,6 @@ files:
543
510
  - lib/metadata/VmConfig/VmConfig.rb
544
511
  - lib/metadata/VmConfig/cfgConfig.rb
545
512
  - lib/metadata/VmConfig/ovfConfig.rb
546
- - lib/metadata/VmConfig/test/GetVMwareCfgTest.rb
547
513
  - lib/metadata/VmConfig/vmcConfig.rb
548
514
  - lib/metadata/VmConfig/vmtxConfig.rb
549
515
  - lib/metadata/VmConfig/vmxConfig.rb
@@ -558,10 +524,6 @@ files:
558
524
  - lib/metadata/linux/LinuxUtils.rb
559
525
  - lib/metadata/linux/MiqConaryPackages.rb
560
526
  - lib/metadata/linux/MiqRpmPackages.rb
561
- - lib/metadata/linux/test/Name
562
- - lib/metadata/linux/test/Packages
563
- - lib/metadata/linux/test/rpoTest.rb
564
- - lib/metadata/linux/test/tc_LinuxUtils.rb
565
527
  - lib/metadata/util/event_log_filter.rb
566
528
  - lib/metadata/util/md5deep.rb
567
529
  - lib/metadata/util/win32/Win32Accounts.rb
@@ -597,8 +559,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
597
559
  - !ruby/object:Gem::Version
598
560
  version: '0'
599
561
  requirements: []
600
- rubyforge_project:
601
- rubygems_version: 2.6.12
562
+ rubygems_version: 3.0.6
602
563
  signing_key:
603
564
  specification_version: 4
604
565
  summary: ManageIQ SmartState Analysis
@@ -1,52 +0,0 @@
1
- require 'manageiq-gems-pending'
2
- require 'openssl' # Required for 'Digest' in camcorder (< Ruby 2.1)
3
- require 'camcorder'
4
- require 'MiqVm/MiqVm'
5
-
6
- require 'logger'
7
- $log = Logger.new(STDERR)
8
- $log.level = Logger::DEBUG
9
-
10
- #
11
- # Path to RAW disk image.
12
- #
13
- VIRTUAL_DISK_FILE = "path to raw disk image file"
14
-
15
- commit = true
16
-
17
- begin
18
- recorder = Camcorder::Recorder.new("#{File.dirname(__FILE__)}/foo.yml")
19
- Camcorder.default_recorder = recorder
20
- Camcorder.intercept_constructor(MiqLargeFile::MiqLargeFileOther) do
21
- methods_with_side_effects :seek, :read, :write
22
- end
23
- Camcorder.intercept_constructor(MiqLargeFile::MiqLargeFileStat)
24
-
25
- recorder.start
26
-
27
- hardware = "scsi0:0.present = \"TRUE\"\n"
28
- hardware += "scsi0:0.filename = \"#{VIRTUAL_DISK_FILE}\"\n"
29
-
30
- ost = OpenStruct.new
31
- ost.rawDisk = true
32
-
33
- miqVm = MiqVm.new(hardware, ost)
34
-
35
- %w(accounts services software system).each do |cat|
36
- xml = miqVm.extract(cat)
37
- xml.write($stdout, 4)
38
- end
39
- rescue => err
40
- puts err.to_s
41
- puts err.backtrace.join("\n")
42
- commit = false # don't commit recording on error
43
- ensure
44
- miqVm.unmount if miqVm
45
- puts "...done"
46
- if recorder && commit
47
- puts
48
- puts "camcorder: committing recording..."
49
- recorder.commit
50
- puts "done."
51
- end
52
- end
@@ -1,38 +0,0 @@
1
- require 'manageiq-gems-pending'
2
- require 'ostruct'
3
- require 'MiqVm/MiqVm'
4
-
5
- require 'logger'
6
- $log = Logger.new(STDERR)
7
- $log.level = Logger::DEBUG
8
-
9
- VHD = raise "Please define VHD"
10
- diskid = "ide0:0"
11
- hardware = "#{diskid}.present = \"TRUE\"\n"
12
- hardware += "#{diskid}.filename = \"#{VHD}\"\n"
13
-
14
- begin
15
- ost = OpenStruct.new
16
- ost.fileName = VHD
17
- vm = MiqVm.new(hardware, ost)
18
-
19
- vm.rootTrees.each do |fs|
20
- puts "*** Found root tree for #{fs.guestOS}"
21
- puts "Listing files in #{fs.pwd} directory:"
22
- fs.dirEntries.each { |de| puts "\t#{de}" }
23
- puts
24
- end
25
-
26
- CATEGORIES = %w(accounts services software system)
27
- CATEGORIES.each do |cat|
28
- puts "Extracting: #{cat}:"
29
- xml = vm.extract(cat)
30
- xml.write($stdout, 4)
31
- puts
32
- end
33
-
34
- vm.unmount
35
- rescue => err
36
- puts err.to_s
37
- puts err.backtrace.join("\n")
38
- end
@@ -1,67 +0,0 @@
1
- require 'manageiq-gems-pending'
2
- require 'ostruct'
3
- require 'MiqVm/MiqVm'
4
- require 'VmwareWebService/MiqVim'
5
-
6
- require 'logger'
7
- $vim_log = $log = Logger.new(STDERR)
8
-
9
- SERVER = raise "please define SERVER"
10
- USERNAME = raise "please define USERNAME"
11
- PASSWORD = raise "please define PASSWORD"
12
- vim = MiqVim.new(SERVER, USERNAME, PASSWORD)
13
-
14
- vimVm = nil
15
- vm = nil
16
-
17
- alignment = 64 * 1024 # Check for alignment on a 64kB boundary
18
-
19
- begin
20
-
21
- vim.virtualMachinesByMor.values.each do |vmo|
22
- begin
23
- vimVm = vim.getVimVmByMor(vmo['MOR'])
24
-
25
- vmx = vimVm.dsPath
26
- puts "VM: #{vimVm.name}, VMX = #{vmx}"
27
-
28
- if vimVm.poweredOn?
29
- puts "\tSkipping running VM"
30
- puts
31
- next
32
- end
33
-
34
- ost = OpenStruct.new
35
- ost.miqVim = vim
36
-
37
- #
38
- # Given an MiqVm object, we check to see if its partitions are aligned on a given boundary.
39
- # This boundary is usually based on the logical block size of the underlying storage array;
40
- # in this example, 64kB.
41
- #
42
- vm = MiqVm.new(vmx, ost)
43
-
44
- #
45
- # We check all of physical volumes of the VM. This Includes visible and hidden volumes, but excludes logical volumes.
46
- # The alignment of hidden volumes affects the performance of the logical volumes that are based on them.
47
- #
48
- vm.volumeManager.allPhysicalVolumes.each do |pv|
49
- vmdk = pv.dInfo.filename || pv.dInfo.vixDiskInfo[:fileName]
50
- aligned = pv.startByteAddr % alignment == 0 ? "Yes" : "No"
51
- puts "\t#{vmdk}, Partition: #{pv.partNum}, Partition type: #{pv.partType}, LBA: #{pv.lbaStart}, offset: #{pv.startByteAddr}, aligned: #{aligned}"
52
- end
53
-
54
- puts
55
- ensure
56
- vimVm.release if vimVm
57
- vm.unmount if vm
58
- vimVm = vm = nil
59
- end
60
- end
61
-
62
- rescue => err
63
- puts err.to_s
64
- puts err.backtrace.join("\n")
65
- ensure
66
- vim.disconnect if vim
67
- end
@@ -1,56 +0,0 @@
1
- require 'manageiq-gems-pending'
2
- require 'ostruct'
3
- require 'MiqVm/MiqVm'
4
- require 'VMwareWebService/MiqVim'
5
-
6
- require 'logger'
7
- $vim_log = $log = Logger.new(STDERR)
8
-
9
- SERVER = raise "please define SERVER"
10
- PORT = 443
11
- DOMAIN = raise "please define DOMAIN"
12
- USERNAME = raise "please define USERNAME"
13
- PASSWORD = raise "please define PASSWORD"
14
- TARGET_VM = raise "please define TARGET_VM"
15
-
16
- vim = MiqVim.new(SERVER, USERNAME, PASSWORD)
17
-
18
- begin
19
- vim_vm = vim.getVimVmByFilter("config.name" => TARGET_VM)
20
-
21
- unless vim_vm
22
- puts "VM: #{TARGET_VM} not found"
23
- vim.disconnect
24
- exit
25
- end
26
-
27
- vmx = vim_vm.dsPath.to_s
28
- puts "Found target VM: #{TARGET_VM}, VMX = #{vmx}"
29
-
30
- ost = OpenStruct.new
31
- ost.miqVim = vim
32
-
33
- vm = MiqVm.new(vmx, ost)
34
-
35
- vm.rootTrees.each do |fs|
36
- puts "*** Found root tree for #{fs.guestOS}"
37
- puts "Listing files in #{fs.pwd} directory:"
38
- fs.dirEntries.each { |de| puts "\t#{de}" }
39
- puts
40
- end
41
-
42
- CATEGORIES = %w(accounts services software system)
43
- CATEGORIES.each do |cat|
44
- puts "Extracting: #{cat}:"
45
- xml = vm.extract(cat)
46
- xml.write($stdout, 4)
47
- puts
48
- end
49
-
50
- vm.unmount
51
-
52
- vim.disconnect
53
- rescue => err
54
- puts err.to_s
55
- puts err.backtrace.join("\n")
56
- end
@@ -1,54 +0,0 @@
1
- #
2
- # This test assumes the NFS share of the storage in question is mounted on the appliance.
3
- #
4
-
5
- require 'manageiq-gems-pending'
6
- require 'ostruct'
7
- require 'MiqVm/MiqVm'
8
-
9
- require 'logger'
10
- $log = Logger.new(STDERR)
11
- $log.level = Logger::DEBUG
12
-
13
- DDIR = "/mnt/vm/7fd0b9b2-e362-11e2-97b7-001a4aa8fcea/rhev/data-center/773f2ddf-7765-42fc-85d6-673b718541cd/aa7e70e5-40d0-43e2-a605-92ce6ba652a8/images/19449cf8-1905-4b8a-b45a-e845a693a3df"
14
- BASE_FILE = "#{DDIR}/903306be-f676-4005-a813-daa6d7a6c33f"
15
- REDO_FILE = "#{DDIR}/9e7075c5-a014-4ddf-a168-a33723d0c3cd"
16
-
17
- # DISK_FILE = BASE_FILE
18
- DISK_FILE = REDO_FILE
19
-
20
- diskid = "scsi0:0"
21
- hardware = "#{diskid}.present = \"TRUE\"\n"
22
- hardware += "#{diskid}.filename = \"#{DISK_FILE}\"\n"
23
-
24
- begin
25
- puts
26
- puts `file #{DISK_FILE}`
27
- puts
28
-
29
- ost = OpenStruct.new
30
- ost.fileName = DISK_FILE
31
-
32
- vm = MiqVm.new(hardware, ost)
33
-
34
- raise "No filesystems detected." if vm.rootTrees.empty?
35
-
36
- puts "\nChecking for file systems..."
37
- vm.rootTrees.each do |fs|
38
- puts "*** Found root tree for #{fs.guestOS}"
39
- puts "Listing files in #{fs.pwd} directory:"
40
- fs.dirEntries.each { |de| puts "\t#{de}" }
41
- puts
42
- end
43
-
44
- ["services", "software", "system", "vmconfig"].each do |c|
45
- puts
46
- puts "Extracting #{c}"
47
- vm.extract(c) # .to_xml.write($stdout, 4)
48
- end
49
- rescue => err
50
- $log.error err.to_s
51
- $log.error err.backtrace.join("\n")
52
- ensure
53
- # vm.unmount if vm
54
- end
@@ -1,58 +0,0 @@
1
- #
2
- # This test assumes the NFS share of the storage in question is mounted on the appliance.
3
- #
4
-
5
- require 'manageiq-gems-pending'
6
- require 'ostruct'
7
- require 'MiqVm/MiqVm'
8
-
9
- require 'logger'
10
- $log = Logger.new(STDERR)
11
- $log.level = Logger::DEBUG
12
-
13
- DDIR = "/mnt/vm/7fd0b9b2-e362-11e2-97b7-001a4aa8fcea/rhev/data-center/773f2ddf-7765-42fc-85d6-673b718541cd/aa7e70e5-40d0-43e2-a605-92ce6ba652a8/images/19449cf8-1905-4b8a-b45a-e845a693a3df"
14
- BASE_FILE = "#{DDIR}/903306be-f676-4005-a813-daa6d7a6c33f"
15
- REDO_FILE = "#{DDIR}/9e7075c5-a014-4ddf-a168-a33723d0c3cd"
16
-
17
- # DISK_FILE = BASE_FILE
18
- DISK_FILE = REDO_FILE
19
-
20
- diskid = "scsi0:0"
21
- hardware = "#{diskid}.present = \"TRUE\"\n"
22
- hardware += "#{diskid}.filename = \"#{DISK_FILE}\"\n"
23
-
24
- begin
25
- puts
26
- puts `file #{DISK_FILE}`
27
- puts
28
-
29
- ost = OpenStruct.new
30
- ost.fileName = DISK_FILE
31
-
32
- unless (disk = MiqDisk.getDisk(ost))
33
- puts "Failed to open disk"
34
- exit(1)
35
- end
36
-
37
- unless (parts = disk.getPartitions)
38
- puts "No partitions detected"
39
- exit(1)
40
- end
41
-
42
- unless (part = parts.detect { |p| p.partNum == 1 })
43
- puts "Could not find partition 1"
44
- exit(1)
45
- end
46
-
47
- unless (mfs = MiqFS.getFS(part))
48
- puts "No filesystem detected"
49
- exit(1)
50
- end
51
-
52
- puts "Found #{mfs.fsType} filesystem"
53
- rescue => err
54
- $log.error err.to_s
55
- $log.error err.backtrace.join("\n")
56
- ensure
57
- # vm.unmount if vm
58
- end