manageiq-smartstate 0.5.1 → 0.5.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
  SHA1:
3
- metadata.gz: 716aa4395ecc988d0cb62308cabef745a9fe6e4d
4
- data.tar.gz: 01fd9eb7d27bb07593b60b66d9412ed65e032dcd
3
+ metadata.gz: 4ee1b8fd08ac112af3f9c643ac6ae7a41b6dfef7
4
+ data.tar.gz: 973ebff243838e870439abc1996354f14159ba7c
5
5
  SHA512:
6
- metadata.gz: 491debebea68f7fc8a5f12c4715061b0db955d9c61c73f3ebbda01ed18ea2bb5e6da3bf2589065ddcd5db597cfcb3bf1b022b89888dcbff2146c2840d84925ac
7
- data.tar.gz: 604bd296a8641e42d8e223c99bf546104e083f5d9fa5be61f9af73e849b3218205e5d43ac1bb8de18aca4c7424232647845473c091719d03ad05641986e2db8f
6
+ metadata.gz: f1c82c83f6d311c98352f940d501e0a2e20fccd15436e05755fc245c95eb3406eea3c5c8c79338dce41321d22c488a248b7ded0d9731a80147bd5ec64ba7488e
7
+ data.tar.gz: 257dc3420aaccfdeba53bb3359c313e9d13514757427514119e201cd6a0eea189d0cc8a979986570a4824f9de15111ea607ec7afdfbec2ca5a5b40b452bfd75a
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module Smartstate
3
- VERSION = "0.5.1".freeze
3
+ VERSION = "0.5.2".freeze
4
4
  end
5
5
  end
@@ -409,10 +409,10 @@ class VmConfig
409
409
  ems_display_text = "host(#{ems_host['use_vim_broker'] ? 'via broker' : 'directly'}):#{ems_host['host']}"
410
410
  $log.info "#{conn_reason}: Connecting to [#{ems_display_text}] for VM:[#{vmCfgFile}]"
411
411
 
412
- require 'VMwareWebService/miq_fault_tolerant_vim'
412
+ require 'VMwareWebService/MiqVim'
413
413
 
414
414
  password_decrypt = ManageIQ::Password.decrypt(ems_host['password'])
415
- hostVim = MiqFaultTolerantVim.new(:ip => ems_host['host'], :user => ems_host['user'], :pass => password_decrypt, :use_broker => ems_host['use_vim_broker'], :vim_broker_drb_uri => ems_host['vim_broker_drb_uri'])
415
+ hostVim = MiqVim.new(ems_host['host'], ems_host['user'], password_decrypt)
416
416
  $log.info "#{conn_reason}: Connection to [#{ems_display_text}] completed for VM:[#{vmCfgFile}] in [#{Time.now - st}] seconds"
417
417
  return hostVim
418
418
  rescue Timeout::Error => err
@@ -126,37 +126,40 @@ class MD5deep
126
126
 
127
127
  begin
128
128
  # unless File.directory?(currFile) then
129
- unless isDir?(currFile)
130
- # File we have an exclusion list and the current file is in it, skip to the next file
131
- @fullFileCount += 1
132
- fh = fileOpen(currFile)
133
-
134
- xmlFileNode = xmlNode.add_element("file", "name" => x, "fqname" => currFile)
135
- statHash = {}
136
- statHash.merge!(getFileStats(fh))
137
- statHash.merge!(calculate_digest(fh))
138
- xmlFileNode.add_attributes(statHash)
139
-
140
- ext = File.extname(currFile).downcase
141
- if @opts.winVerList.include?(ext)
142
- if @opts.versioninfo || @opts.imports
143
- peHdr = PEheader.new(fh) rescue nil
144
- unless peHdr.nil?
145
- xmlFileNode.add_element("versioninfo", peHdr.versioninfo) if @opts.versioninfo && !peHdr.versioninfo.blank?
146
- xmlFileNode.add_element("libraries", "imports" => peHdr.getImportList) if @opts.imports && !peHdr.imports.blank?
147
- end
148
- end
149
- end
150
-
151
- getFileContents(fh, xmlFileNode) if @opts.contents == true
152
- fh.close
129
+ return if isDir?(currFile)
130
+
131
+ # File we have an exclusion list and the current file is in it, skip to the next file
132
+ @fullFileCount += 1
133
+ fh = fileOpen(currFile)
134
+
135
+ xmlFileNode = xmlNode.add_element("file", "name" => x, "fqname" => currFile)
136
+ statHash = {}
137
+ statHash.merge!(getFileStats(fh))
138
+ statHash.merge!(calculate_digest(fh))
139
+ xmlFileNode.add_attributes(statHash)
140
+
141
+ ext = File.extname(currFile).downcase
142
+ if @opts.winVerList.include?(ext)
143
+ pe_hdr = PEheader.new(fh) rescue nil
144
+ process_pe_header(pe_hdr, xmlFileNode) unless pe_hdr.nil?
153
145
  end
146
+
147
+ getFileContents(fh, xmlFileNode) if @opts.contents == true
148
+ fh.close
154
149
  rescue Errno::EACCES, RuntimeError, SystemCallError
155
150
  fh.close if fh.kind_of?(File) && !fh.closed?
156
151
  end
157
152
  end
158
153
  end
159
154
 
155
+ def process_pe_header(pe_hdr, xml_file_node)
156
+ xml_file_node.add_element("versioninfo", pe_hdr.versioninfo) if @opts.versioninfo && pe_hdr.versioninfo.present?
157
+ xml_file_node.add_element("libraries", "imports" => pe_hdr.getImportList) if @opts.imports && pe_hdr.imports.present?
158
+ rescue TypeError => err
159
+ $log.info "processFile: TypeError handling PEheader; skipping PEheader info"
160
+ $log.debug err.backtrace.join("\n")
161
+ end
162
+
160
163
  def isDir?(currFile)
161
164
  if @fs
162
165
  @fs.fileDirectory?(currFile)
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.5.1
4
+ version: 0.5.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: 2020-02-06 00:00:00.000000000 Z
11
+ date: 2020-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure-armrest