manageiq-smartstate 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c4e0ae5df27aeb31c51bf3cd62249be2b2a53d8
4
- data.tar.gz: d8dc954b070111eb849bf9c0b1af5c2e01b5ee7d
3
+ metadata.gz: 00a7fd279564b332f1a1d404da7cd92cd41d9827
4
+ data.tar.gz: 4e458d0d28103d49b69edc730c38bf3ca1fe9a01
5
5
  SHA512:
6
- metadata.gz: e59d6441ae21c768e7b25e046dd66395638d21845a4b8465a7c19b0c15a04c43aeaa7a7b0820d483a81562c77726f894a2b82fd39e59ac36e5391e734a3cb66c
7
- data.tar.gz: fef77f29b8e8f2409c0320ea7463d8cd1ccb55fcb31b9cfcad3e187f300b784999b0d94736617b8084db7ea337a30185f08a4183e5bcdf8b73ad6270a5bf8e2c
6
+ metadata.gz: 11c5b3bed6d746d0631bed97dc25fff334c845446b33553c467913c2cd404d1dc1ba26cc4ee7118de535ce08592d6ff143102d9d036106af8426ea0a2c538825
7
+ data.tar.gz: 3b6392fed96603ef12de4214a004bf9a36c5cda4e40064452d43c6e8bc1841bbc22f359f6bf9aed6e97e62600bc1c5afa6849931fdd035e59c04bddc1381c3f7
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module Smartstate
3
- VERSION = "0.3.4".freeze
3
+ VERSION = "0.3.5".freeze
4
4
  end
5
5
  end
@@ -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.3.4
4
+ version: 0.3.5
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-12-09 00:00:00.000000000 Z
11
+ date: 2020-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure-armrest