manageiq-smartstate 0.5.8 → 0.6.2

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
  SHA256:
3
- metadata.gz: 17b37f4ab83cd03d58b45b02fdeaf8bff3d9c994f7a75b2807bf2ab3334ddf1d
4
- data.tar.gz: 30fc42e24da1123a3affb75b781e7629fd98e156c9349cbb733a23cdfced8f53
3
+ metadata.gz: 73464e1eb16a92655a6a6038ccc47172d642c89d77803f887dc6b049c4ce6121
4
+ data.tar.gz: f0f7e19851c0602b23b187fb89b81bdd3e8b1a0223584875725235d6ef93ab7f
5
5
  SHA512:
6
- metadata.gz: 22ef45df273e3a8d491d3ad99e0e8e279b35cd9b4b62293c2aaecc80ef8df6de724c71badaf2c966a3f597b8fa82c4be423bb24faa4c79e4b4857318ad18118b
7
- data.tar.gz: d4ea9bfb29b732a621534471cc3d83da6924aa95318f9a2618a9c7dc96be063538f5eb01c1e7a598609650b89a6409aba57b671aa320b31f64a1304efb39c46b
6
+ metadata.gz: 32310373dbd4f1ae177a330572472ad6c76fb1cf9578b3bbdba2f5eeddf3a97e6482f56b2624f3f5d215ac017f60f397841b1096bb69960acdb5f043de64bcbe
7
+ data.tar.gz: ee53ecb1e307bf90218f005fa189869fa9dcd01fe80e9bf1900da7920004368f2558251a17533444d551067bbfd0296dfd96ec8231a360d51906a14d2f9a06f2
@@ -3,8 +3,8 @@ sudo: false
3
3
  cache: bundler
4
4
  language: ruby
5
5
  rvm:
6
- - 2.5.7
7
- - 2.6.5
6
+ - 2.5.8
7
+ - 2.6.6
8
8
  after_script: bundle exec codeclimate-test-reporter
9
9
  notifications:
10
10
  webhooks:
@@ -42,7 +42,7 @@ class MiqRhevmVm < MiqVm
42
42
  disks = @rhevm.collect_vm_disks(@rhevmVm)
43
43
  disks.each_with_index do |disk, idx|
44
44
  $log.debug "MiqRhevmVm#getCfg: disk = #{disk.inspect}"
45
- storage_domain = disk.storage_domains.first
45
+ storage_domain = disk.storage_domains&.first
46
46
  if storage_domain.nil?
47
47
  $log.info("Disk <#{disk.name}> is skipped due to unassigned storage domain")
48
48
  next
@@ -205,143 +205,3 @@ class MiqVm
205
205
  (xml)
206
206
  end
207
207
  end # class MiqVm
208
-
209
- if __FILE__ == $0
210
- require 'metadata/util/win32/boot_info_win'
211
-
212
- # vmDir = File.join(ENV.fetch("HOME", '.'), 'VMs')
213
- vmDir = "/volumes/WDpassport/Virtual Machines"
214
- puts "vmDir = #{vmDir}"
215
-
216
- targetLv = "rpolv2"
217
- rootLv = "LogVol00"
218
-
219
- require 'logger'
220
- $log = Logger.new(STDERR)
221
- $log.level = Logger::DEBUG
222
-
223
- #
224
- # *** Test start
225
- #
226
-
227
- # vmCfg = File.join(vmDir, "cacheguard/cacheguard.vmx")
228
- # vmCfg = File.join(vmDir, "Red Hat Linux.vmwarevm/Red Hat Linux.vmx")
229
- # vmCfg = File.join(vmDir, "MIQ Server Appliance - Ubuntu MD - small/MIQ Server Appliance - Ubuntu.vmx")
230
- # vmCfg = File.join(vmDir, "winxpDev.vmwarevm/winxpDev.vmx")
231
- vmCfg = File.join(vmDir, "Win2K_persistent/Windows 2000 Professional.vmx")
232
- # vmCfg = File.join(vmDir, "Win2K_non_persistent/Windows 2000 Professional.vmx")
233
- puts "VM config file: #{vmCfg}"
234
-
235
- ost = OpenStruct.new
236
- ost.openParent = true
237
-
238
- vm = MiqVm.new(vmCfg, ost)
239
-
240
- puts "\n*** Disk Files:"
241
- vm.vmConfig.getDiskFileHash.each do |k, v|
242
- puts "\t#{k}\t#{v}"
243
- end
244
-
245
- puts "\n*** configHash:"
246
- vm.vmConfig.getHash.each do |k, v|
247
- puts "\t#{k} => #{v}"
248
- end
249
-
250
- tlv = nil
251
- rlv = nil
252
- puts "\n*** Visible Volumes:"
253
- vm.volumeManager.visibleVolumes.each do |vv|
254
- puts "\tDisk type: #{vv.diskType}"
255
- puts "\tDisk sig: #{vv.diskSig}"
256
- puts "\tStart LBA: #{vv.lbaStart}"
257
- if vv.respond_to?(:logicalVolume)
258
- puts "\t\tLV name: #{vv.logicalVolume.lvName}"
259
- puts "\t\tLV UUID: #{vv.logicalVolume.lvId}"
260
- tlv = vv if vv.logicalVolume.lvName == targetLv
261
- rlv = vv if vv.logicalVolume.lvName == rootLv
262
- end
263
- end
264
-
265
- # raise "#{targetLv} not found" if !tlv
266
- #
267
- # tlv.seek(0, IO::SEEK_SET)
268
- # rs = tlv.read(2040)
269
- # puts "\n***** START *****"
270
- # puts rs
271
- # puts "****** END ******"
272
- #
273
- # tlv.seek(2048*512*5119, IO::SEEK_SET)
274
- # rs = tlv.read(2040)
275
- # puts "\n***** START *****"
276
- # puts rs
277
- # puts "****** END ******"
278
- #
279
- # raise "#{rootLv} not found" if !rlv
280
- #
281
- # puts "\n*** Mounting #{rootLv}"
282
- # rfs = MiqFS.getFS(rlv)
283
- # puts "\tFS Type: #{rfs.fsType}"
284
- # puts "\t*** Root-level files and directories:"
285
- # rfs.dirForeach("/") { |de| puts "\t\t#{de}" }
286
-
287
- puts "\n***** Detected Guest OSs:"
288
- raise "No OSs detected" if vm.rootTrees.length == 0
289
- vm.rootTrees.each do |rt|
290
- puts "\t#{rt.guestOS}"
291
- if rt.guestOS == "Linux"
292
- puts "\n\t\t*** /etc/fstab contents:"
293
- rt.fileOpen("/etc/fstab", &:read).each_line do |fstl|
294
- next if fstl =~ /^#.*$/
295
- puts "\t\t\t#{fstl}"
296
- end
297
- end
298
- end
299
-
300
- vm.rootTrees.each do |rt|
301
- if rt.guestOS == "Linux"
302
- # tdirArr = [ "/", "/boot", "/var/www/miq", "/var/www/miq/vmdb/log", "/var/lib/mysql" ]
303
- tdirArr = ["/", "/boot", "/etc/init.d", "/etc/rc.d/init.d", "/etc/rc.d/rc0.d"]
304
-
305
- tdirArr.each do |tdir|
306
- begin
307
- puts "\n*** Listing #{tdir} directory (1):"
308
- rt.dirForeach(tdir) { |de| puts "\t\t#{de}" }
309
- puts "*** end"
310
-
311
- puts "\n*** Listing #{tdir} directory (2):"
312
- rt.chdir(tdir)
313
- rt.dirForeach { |de| puts "\t\t#{de}" }
314
- puts "*** end"
315
- rescue => err
316
- puts "*** #{err}"
317
- end
318
- end
319
-
320
- # lf = rt.fileOpen("/etc/rc0.d/S01halt")
321
- # puts "\n*** Contents of /etc/rc0.d/S01halt:"
322
- # puts lf.read
323
- # puts "*** END"
324
- # lf.close
325
- #
326
- # lfn = "/etc/rc0.d/S01halt"
327
- # puts "Is #{lfn} a symbolic link? #{rt.fileSymLink?(lfn)}"
328
- # puts "#{lfn} => #{rt.getLinkPath(lfn)}"
329
- else # Windows
330
- tdirArr = ["c:/", "e:/", "e:/testE2", "f:/"]
331
-
332
- tdirArr.each do |tdir|
333
- puts "\n*** Listing #{tdir} directory (1):"
334
- rt.dirForeach(tdir) { |de| puts "\t\t#{de}" }
335
- puts "*** end"
336
-
337
- puts "\n*** Listing #{tdir} directory (2):"
338
- rt.chdir(tdir)
339
- rt.dirForeach { |de| puts "\t\t#{de}" }
340
- puts "*** end"
341
- end
342
- end
343
- end
344
-
345
- vm.unmount
346
- puts "...done"
347
- end
@@ -1,5 +1,4 @@
1
- require 'util/miq_tempfile'
2
- require_relative '../../MiqVm/MiqVm'
1
+ require 'miq_tempfile'
3
2
  require_relative 'MiqOpenStackCommon'
4
3
 
5
4
  class MiqOpenStackImage
@@ -1,5 +1,4 @@
1
1
  require 'miq_tempfile'
2
- require_relative '../../MiqVm/MiqVm'
3
2
  require_relative 'MiqOpenStackCommon'
4
3
 
5
4
  #
@@ -5,7 +5,7 @@
5
5
 
6
6
  require 'ostruct'
7
7
  require 'binary_struct'
8
- require 'util/miq-uuid'
8
+ require 'uuidtools'
9
9
 
10
10
  class BinaryStruct
11
11
  def self.stepDecode(data, format)
@@ -5,7 +5,6 @@ require 'enumerator'
5
5
 
6
6
  require 'binary_struct'
7
7
  require_relative 'MiqSqlite3Util'
8
- require_relative 'MiqSqlite3Page'
9
8
 
10
9
  module MiqSqlite3DB
11
10
  class MiqSqlite3Cell
@@ -150,8 +149,8 @@ module MiqSqlite3DB
150
149
  when 2 then return 2, 'integer'
151
150
  when 3 then return 3, 'integer'
152
151
  when 4 then return 4, 'integer'
153
- when 6 then return 6, 'integer'
154
- when 8 then return 8, 'integer'
152
+ when 5 then return 6, 'integer'
153
+ when 6 then return 8, 'integer'
155
154
  when 7 then return 8, 'float'
156
155
  when 8 then return 0, 'false'
157
156
  when 9 then return 0, 'true'
@@ -4,7 +4,7 @@ require 'fs/ext3/group_descriptor_table'
4
4
  require 'fs/ext3/inode'
5
5
 
6
6
  require 'binary_struct'
7
- require 'util/miq-uuid'
7
+ require 'uuidtools'
8
8
  require 'stringio'
9
9
  require 'memory_buffer'
10
10
 
@@ -4,7 +4,7 @@ require 'fs/ext4/group_descriptor_table'
4
4
  require 'fs/ext4/inode'
5
5
 
6
6
  require 'binary_struct'
7
- require 'util/miq-uuid'
7
+ require 'uuidtools'
8
8
  require 'stringio'
9
9
  require 'memory_buffer'
10
10
 
@@ -225,7 +225,7 @@ module Ext4
225
225
  end
226
226
 
227
227
  def groupDescriptorSize
228
- @groupDescriptorSize ||= is_enabled_64_bit? ? @sb['group_desc_size'] : GDE_SIZE
228
+ @groupDescriptorSize ||= is_enabled_64_bit? ? @sb['group_desc_size'] : GDE_SIZE
229
229
  end
230
230
 
231
231
  def freeBytes
@@ -321,9 +321,9 @@ module LinuxMount
321
321
  #
322
322
  no_more_links = false
323
323
  until no_more_links
324
- filesys, link_ptr = getFsPathBase(link_ptr)
325
- if filesys.fileSymLink?(link_ptr)
326
- symlink = getSymLink(filesys, link_ptr)
324
+ filesys, tmp_link_ptr = getFsPathBase(link_ptr)
325
+ if filesys.fileSymLink?(tmp_link_ptr)
326
+ symlink = getSymLink(filesys, tmp_link_ptr)
327
327
  link_ptr = symlink[0, 1] == '/' ? symlink : File.join(File.dirname(link_ptr), symlink)
328
328
  else
329
329
  no_more_links = true
@@ -1,4 +1,4 @@
1
- require 'util/miq-uuid'
1
+ require 'uuidtools'
2
2
 
3
3
  module NTFS
4
4
  # There is no real data definition for this class - it consists entirely of GUIDs.
@@ -1,5 +1,5 @@
1
1
  require 'binary_struct'
2
- require 'util/miq-uuid'
2
+ require 'uuidtools'
3
3
  require 'stringio'
4
4
  require 'memory_buffer'
5
5
  require 'fs/xfs/superblock'
@@ -1,5 +1,5 @@
1
1
  require 'binary_struct'
2
- require 'util/miq-uuid'
2
+ require 'uuidtools'
3
3
  require 'stringio'
4
4
 
5
5
  require 'rufus/lru'
@@ -1,7 +1,7 @@
1
1
  # encoding: US-ASCII
2
2
 
3
3
  require 'binary_struct'
4
- require 'util/miq-uuid'
4
+ require 'uuidtools'
5
5
  require 'stringio'
6
6
  require 'memory_buffer'
7
7
  require 'fs/xfs/allocation_group'
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module Smartstate
3
- VERSION = "0.5.8".freeze
3
+ VERSION = "0.6.2".freeze
4
4
  end
5
5
  end
@@ -1,4 +1,3 @@
1
- require 'MiqVm/MiqVm'
2
1
  require 'metadata/util/md5deep'
3
2
  require 'util/miq-xml'
4
3
  require 'ostruct'
@@ -100,7 +99,7 @@ class MIQExtract
100
99
  yield({:msg => 'Scanning Profile-Registry'}) if block_given?
101
100
 
102
101
  filters = []
103
- reg_filters[:HKCU].to_miq_a.each { |f| filters << {:key => split_registry(f['key']).join('/'), :depth => f['depth']} }
102
+ Array.wrap(reg_filters[:HKCU]).each { |f| filters << {:key => split_registry(f['key']).join('/'), :depth => f['depth']} }
104
103
  @scanProfiles.parse_data(@target, RemoteRegistry.new(@systemFs, @xml_class).loadCurrentUser(filters)) unless filters.empty?
105
104
 
106
105
  filters = {}
@@ -127,7 +126,7 @@ class MIQExtract
127
126
 
128
127
  def extract(category, &blk)
129
128
  xml = nil
130
- category.to_miq_a.each do |c|
129
+ Array.wrap(category.presence).each do |c|
131
130
  c = c.downcase
132
131
  xml = case c
133
132
  when "accounts" then getAccounts(c)
@@ -364,7 +364,7 @@ class VmConfig
364
364
 
365
365
  def resolve_ds_path(filename)
366
366
  # TODO: Determine if we need to do any work here.
367
- ds, dir, name = split_filename(filename)
367
+ ds, _dir, _name = split_filename(filename)
368
368
  return filename unless ds.nil?
369
369
 
370
370
  @ds_replace ||= {}
@@ -373,7 +373,7 @@ class VmConfig
373
373
  end
374
374
 
375
375
  ds_filename = resolve_ds_path_with_vim(filename)
376
- ds, dir, name = split_filename(ds_filename)
376
+ ds, dir, _name = split_filename(ds_filename)
377
377
  unless ds.nil?
378
378
  idx = filename.index(dir)
379
379
  replaced_str = filename[0, idx]
@@ -498,7 +498,7 @@ class VmConfig
498
498
  end
499
499
 
500
500
  def rhevm_disk_file_entry(disk)
501
- storage_id = disk.storage_domains.first&.id
501
+ storage_id = disk.storage_domains&.first&.id
502
502
  disk_id = disk.image_id || disk.id
503
503
  full_path = storage_id && File.join('/dev', storage_id, disk_id)
504
504
  {:path => full_path, :name => disk_id, :size => disk.actual_size.to_i}
@@ -550,7 +550,7 @@ class VmConfig
550
550
  elsif miqvm.rhevmVm
551
551
  disks = miqvm.rhevm.collect_vm_disks(miqvm.rhevmVm)
552
552
  disks.each do |disk|
553
- storage_id = disk.storage_domains.first&.id
553
+ storage_id = disk.storage_domains&.first&.id
554
554
  disk_id = disk.image_id || disk.id
555
555
  full_path = storage_id && File.join('/dev', storage_id, disk_id)
556
556
  d = {:path => full_path, :name => disk.name.to_s, :size => disk.actual_size.to_i}
@@ -13,6 +13,8 @@ class MD5deep
13
13
  def initialize(fs = nil, options = {})
14
14
  @fullFileCount = 0
15
15
  @fullDirCount = 0
16
+ @drive_letter = nil
17
+
16
18
  # Create XML document
17
19
  @xml = XmlHash.createDoc(:filesystem)
18
20
  @fs = fs.kind_of?(MiqFS) ? fs : nil
@@ -179,9 +181,9 @@ class MD5deep
179
181
 
180
182
  def fileOpen(currFile)
181
183
  if @fs
182
- fh = @fs.fileOpen(currFile)
184
+ @fs.fileOpen(currFile)
183
185
  else
184
- fh = File.open(currFile)
186
+ File.open(currFile)
185
187
  end
186
188
  end
187
189
 
@@ -684,8 +684,8 @@ class Win32EventLog
684
684
  reg.each_key do |subKey, _wtime|
685
685
  subpath = "#{src}\\#{subKey}"
686
686
  subKey.downcase!
687
- Win32::Registry::HKEY_LOCAL_MACHINE.open(subpath) do |reg|
688
- reg.each_value do |name, _type, data|
687
+ Win32::Registry::HKEY_LOCAL_MACHINE.open(subpath) do |subreg|
688
+ subreg.each_value do |name, _type, data|
689
689
  case name
690
690
  when 'EventMessageFile', 'ParameterMessageFile', 'CategoryMessageFile' then
691
691
  fn = data.to_s
@@ -15,8 +15,6 @@ class PEheader
15
15
  IMAGE_NT_SIGNATURE = "PE\0\0"
16
16
  IMAGE_DOS_SIGNATURE = "MZ"
17
17
 
18
- attr_reader :imports, :icons, :messagetables, :versioninfo
19
-
20
18
  def initialize(path)
21
19
  @fname = path
22
20
  @dataDirs = []
@@ -91,19 +89,19 @@ class PEheader
91
89
  end
92
90
 
93
91
  def imports
94
- @import_array ||= getImports
92
+ @imports ||= getImports
95
93
  end
96
94
 
97
95
  def icons
98
- @icon_array ||= getIcons(@fBuf)
96
+ @icons ||= getIcons(@fBuf)
99
97
  end
100
98
 
101
99
  def messagetables
102
- @messagetable_hash ||= getMessagetables
100
+ @messagetables ||= getMessagetables
103
101
  end
104
102
 
105
103
  def versioninfo
106
- @versioninfo_array ||= getVersioninfo
104
+ @versioninfo ||= getVersioninfo
107
105
  end
108
106
 
109
107
  # //////////////////////////////////////////////////////////////////////////
@@ -20,7 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_dependency "azure-armrest", "~> 0.9.6"
23
+ spec.add_dependency "activesupport"
24
+ spec.add_dependency "azure-armrest", "~> 0.9"
24
25
  spec.add_dependency "binary_struct", "~> 2.1"
25
26
  spec.add_dependency "iniparse"
26
27
  spec.add_dependency "linux_block_device", "~>0.2.1"
@@ -28,7 +29,8 @@ Gem::Specification.new do |spec|
28
29
  spec.add_dependency "memory_buffer", ">=0.1.0"
29
30
  spec.add_dependency "rufus-lru", "~>1.0.3"
30
31
  spec.add_dependency "sys-uname", "~>1.2.1"
31
- spec.add_dependency "vmware_web_service", "~>1.0"
32
+ spec.add_dependency "uuidtools", "~>2.1"
33
+ spec.add_dependency "vmware_web_service", "~>2.0"
32
34
 
33
35
  spec.add_development_dependency "bundler"
34
36
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-smartstate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-14 00:00:00.000000000 Z
11
+ date: 2020-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: azure-armrest
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: 0.9.6
33
+ version: '0.9'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: 0.9.6
40
+ version: '0.9'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: binary_struct
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -122,20 +136,34 @@ dependencies:
122
136
  - - "~>"
123
137
  - !ruby/object:Gem::Version
124
138
  version: 1.2.1
139
+ - !ruby/object:Gem::Dependency
140
+ name: uuidtools
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '2.1'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '2.1'
125
153
  - !ruby/object:Gem::Dependency
126
154
  name: vmware_web_service
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
157
  - - "~>"
130
158
  - !ruby/object:Gem::Version
131
- version: '1.0'
159
+ version: '2.0'
132
160
  type: :runtime
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
164
  - - "~>"
137
165
  - !ruby/object:Gem::Version
138
- version: '1.0'
166
+ version: '2.0'
139
167
  - !ruby/object:Gem::Dependency
140
168
  name: bundler
141
169
  requirement: !ruby/object:Gem::Requirement
@@ -263,7 +291,7 @@ dependencies:
263
291
  - !ruby/object:Gem::Version
264
292
  version: 1.0.0
265
293
  description: ManageIQ SmartState Analysis
266
- email:
294
+ email:
267
295
  executables: []
268
296
  extensions: []
269
297
  extra_rdoc_files: []
@@ -546,7 +574,7 @@ homepage: https://github.com/ManageIQ/manageiq-smartstate
546
574
  licenses:
547
575
  - Apache-2.0
548
576
  metadata: {}
549
- post_install_message:
577
+ post_install_message:
550
578
  rdoc_options: []
551
579
  require_paths:
552
580
  - lib
@@ -561,8 +589,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
561
589
  - !ruby/object:Gem::Version
562
590
  version: '0'
563
591
  requirements: []
564
- rubygems_version: 3.1.2
565
- signing_key:
592
+ rubygems_version: 3.0.3
593
+ signing_key:
566
594
  specification_version: 4
567
595
  summary: ManageIQ SmartState Analysis
568
596
  test_files: []