manageiq-smartstate 0.2.21 → 0.2.22

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
- SHA256:
3
- metadata.gz: 50b1dd0bf0f70ea2d106aad1a7b3ac56a9c75b4ef337118c3ac0a54d9e0f02bf
4
- data.tar.gz: 8ff60122af726e6def12e7b6abfb46b08578e29ed09d226b00106db264520c08
2
+ SHA1:
3
+ metadata.gz: b1d24be0511290fa29a5fff5cb44781de61848c8
4
+ data.tar.gz: 6f5919a4cfdd3a9aa96a8bccf32e2542c46374da
5
5
  SHA512:
6
- metadata.gz: 1cb986da726c693501943cd46a368143b17810653531d063053eeadcf5ba52fdfac4cb0da5f619f71c4c449171c9f16f2fa0e7467cb1d8a9bb97d997545e3071
7
- data.tar.gz: adaca2d378be7538b3b7e600813c611924f416dc77d1fce3d49a04edaa108af5e3877988977dc4057547e6bf3f6fff3707bebc207b1259cd0d8b931853de67fa
6
+ metadata.gz: b5b7055d8ad41d06ffcfb088d9b15ecc4e71e869de043ae19f7ee37956b51d6c3e09513ecaff4841bf144f287bdaec61e4d6219a4f88c67094a3d4980956cdf5
7
+ data.tar.gz: 7a981805bcdbe3ca58aaa6ba0957f9294607ac31dc5313a29d5a59e50b4ad5c612daf3800f7dabb6899fb7aa31a5dc06548f3ea7f043b8e7cc9e8086a7f0aa93
data/.gitignore CHANGED
@@ -14,3 +14,6 @@
14
14
 
15
15
  # rspec failure tracking
16
16
  .rspec_status
17
+
18
+ # Komodo project file
19
+ manageiq-smartstate.komodoproject
data/lib/fs/xfs/inode.rb CHANGED
@@ -302,14 +302,29 @@ module XFS
302
302
  @access_time ||= Time.at(@in['atime_secs'])
303
303
  end
304
304
 
305
+ # For compatibility with other filesystem methods
306
+ def aTime
307
+ access_time
308
+ end
309
+
305
310
  def create_time
306
311
  @create_time ||= Time.at(@in['ctime_secs'])
307
312
  end
308
313
 
314
+ # For compatibility with other filesystem methods
315
+ def cTime
316
+ create_time
317
+ end
318
+
309
319
  def modification_time
310
320
  @modification_time ||= Time.at(@in['mtime_secs'])
311
321
  end
312
322
 
323
+ # For compatibility with other filesystem methods
324
+ def mTime
325
+ modification_time
326
+ end
327
+
313
328
  def permissions
314
329
  @permissions ||= @in['file_mode'] & (MSK_PERM_OWNER | MSK_PERM_GROUP | MSK_PERM_USER)
315
330
  end
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module Smartstate
3
- VERSION = "0.2.21".freeze
3
+ VERSION = "0.2.22".freeze
4
4
  end
5
5
  end
@@ -60,7 +60,7 @@ class MD5deep
60
60
 
61
61
  # First check if we are passed a fully qualifed file name
62
62
  if @fs.fileExists?(filename)
63
- processFile(startDir, globPattern, @xml.root)
63
+ isDir?(filename) ? process_dir_as_file(startDir, globPattern, @xml.root) : processFile(startDir, globPattern, @xml.root)
64
64
  else
65
65
  # If the file is not found then process the data as a glob pattern.
66
66
  @fs.dirGlob(globPattern) do |f|
@@ -108,6 +108,18 @@ class MD5deep
108
108
  end
109
109
  end
110
110
 
111
+ def process_dir_as_file(path, x, xml_node)
112
+ if x != "." && x != ".."
113
+ curr_dir = File.join(path, x)
114
+ if isDir?(curr_dir)
115
+ xml_file_node = xml_node.add_element("file", "name" => x, "fqname" => curr_dir)
116
+ stat_hash = {}
117
+ stat_hash.merge!(get_dir_stats(curr_dir))
118
+ xml_file_node.add_attributes(stat_hash)
119
+ end
120
+ end
121
+ end
122
+
111
123
  def processFile(path, x, xmlNode)
112
124
  if (@opts.exclude.include?(x) == false) && x[0..0] != "$"
113
125
  currFile = File.join(path, x)
@@ -167,6 +179,14 @@ class MD5deep
167
179
  {"size" => fh.size, "atime" => fh.atime.getutc.iso8601, "ctime" => fh.ctime.getutc.iso8601, "mtime" => fh.mtime.getutc.iso8601}
168
180
  end
169
181
 
182
+ def get_dir_stats(dir)
183
+ if @fs
184
+ {"size" => @fs.fileSize(dir), "atime" => @fs.fileAtime(dir).getutc.iso8601, "ctime" => @fs.fileCtime(dir).getutc.iso8601, "mtime" => @fs.fileMtime(dir).getutc.iso8601}
185
+ else
186
+ {"size" => File.size(dir), "atime" => File.stat(dir).atime.getutc.iso8601, "ctime" => File.stat(dir).ctime.getutc.iso8601, "mtime" => File.stat(dir).mtime.getutc.iso8601}
187
+ end
188
+ end
189
+
170
190
  def calculate_sums(xmlNode)
171
191
  rollup = create_digest_hash
172
192
  # Add size to the hash as a Fixnum
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.2.21
4
+ version: 0.2.22
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-03-26 00:00:00.000000000 Z
11
+ date: 2019-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure-armrest
@@ -598,7 +598,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
598
598
  version: '0'
599
599
  requirements: []
600
600
  rubyforge_project:
601
- rubygems_version: 2.7.6
601
+ rubygems_version: 2.6.12
602
602
  signing_key:
603
603
  specification_version: 4
604
604
  summary: ManageIQ SmartState Analysis