manageiq-smartstate 0.5.5 → 0.5.10

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: cd8eb1fbab5fe0cf25e935e7173c43f6cb928b36
4
- data.tar.gz: 6254ef672dd4700f40da31c1b4c98d79b7217510
3
+ metadata.gz: 9339962d9971082ef3464c0a0a2f20d6b2366636
4
+ data.tar.gz: 0a1b72d88811858835e05d7e1468259318c96768
5
5
  SHA512:
6
- metadata.gz: eaa532b372c70837dfaf164ba463374a6235291e5517385469be72d95e6fc60dd3cdb957ac32d1f7ecdb14f87a372785bbe196a10a43d995129906203d38de89
7
- data.tar.gz: bba8041436423755f0a234c566168a7831159da571605638290789a3f9e7246fdda6e75912a2bc9d3b50f1ef236fed74094c284369357a3fc4c2184326642951
6
+ metadata.gz: 07ac4b7630d00c02654eaea1f9c8a33aa155a4a6e770ada1e1cc5c9aec5dfb0d4622b2fdd3ec0c9202c4fa596c8c3ab1607f2415017596e09d82eeabd3bcca75
7
+ data.tar.gz: e0884bd02ece3f99f637140e2cec0f805ff08d784fee5f86c6b1f7336e630b32af6b6852d04b950f1a1c78b4648703d6fa45defbb1a28f1bb8a83118c08b6ad4
data/README.md CHANGED
@@ -1,10 +1,9 @@
1
1
  # ManageIQ::Smartstate
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/manageiq-smartstate.svg)](http://badge.fury.io/rb/manageiq-smartstate)
4
- [![Build Status](https://travis-ci.org/ManageIQ/manageiq-smartstate.svg)](https://travis-ci.org/ManageIQ/manageiq-smartstate)
4
+ [![Build Status](https://travis-ci.com/ManageIQ/manageiq-smartstate.svg)](https://travis-ci.com/ManageIQ/manageiq-smartstate)
5
5
  [![Code Climate](https://codeclimate.com/github/ManageIQ/manageiq-smartstate.svg)](https://codeclimate.com/github/ManageIQ/manageiq-smartstate)
6
6
  [![Test Coverage](https://codeclimate.com/github/ManageIQ/manageiq-smartstate/badges/coverage.svg)](https://codeclimate.com/github/ManageIQ/manageiq-smartstate/coverage)
7
- [![Dependency Status](https://gemnasium.com/ManageIQ/manageiq-smartstate.svg)](https://gemnasium.com/ManageIQ/manageiq-smartstate)
8
7
  [![Security](https://hakiri.io/github/ManageIQ/manageiq-smartstate/master.svg)](https://hakiri.io/github/ManageIQ/manageiq-smartstate/master)
9
8
 
10
9
  [![Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ManageIQ/manageiq-smartstate?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -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
@@ -1,4 +1,4 @@
1
- require 'util/miq_tempfile'
1
+ require 'miq_tempfile'
2
2
  require_relative '../../MiqVm/MiqVm'
3
3
  require_relative 'MiqOpenStackCommon'
4
4
 
@@ -1,4 +1,4 @@
1
- require 'util/miq_tempfile'
1
+ require 'miq_tempfile'
2
2
  require_relative '../../MiqVm/MiqVm'
3
3
  require_relative 'MiqOpenStackCommon'
4
4
 
@@ -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, linkptr)
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
@@ -282,7 +282,7 @@ module NTFS
282
282
 
283
283
  @runSpec.each_slice(2) do |lcn, len|
284
284
  total_clusters += len
285
- next unless total_clusters > start_vcn
285
+ next unless lcn && len && total_clusters > start_vcn
286
286
 
287
287
  start = lcn + (vcn - (total_clusters - len))
288
288
  count = len - (start - lcn)
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module Smartstate
3
- VERSION = "0.5.5".freeze
3
+ VERSION = "0.5.10".freeze
4
4
  end
5
5
  end
@@ -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}
@@ -15,8 +15,9 @@ module FindClassMethods
15
15
 
16
16
  ra = []
17
17
  find(@search_path, glob_depth(glob)) do |p|
18
- p = check_file(p, glob, flags)
19
- p && block_given? ? yield(p) : ra << p
18
+ if (p = check_file(p, glob, flags))
19
+ block_given? ? yield(p) : ra << p
20
+ end
20
21
  end
21
22
  ra.sort_by(&:downcase)
22
23
  end
@@ -70,7 +71,7 @@ module FindClassMethods
70
71
  return [] unless @fs.fileExists?(directory) && @fs.fileDirectory?(directory)
71
72
 
72
73
  files = @fs.dirEntries(directory)
73
- files.difference([".", ".."])
74
+ files -= [".", ".."]
74
75
  files.sort!
75
76
  files.reverse_each
76
77
  rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
@@ -72,13 +72,14 @@ class MD5deep
72
72
 
73
73
  def process_each_glob_file(file_name)
74
74
  FindClassMethods.glob(file_name, @fs) do |f|
75
- # Passing "startDir" as the first parameter is a work-around for issues
76
- # when scanning Win VMs from Linux where the path returned from dirGlob
77
- # do not include the drive letter.
75
+ # Prepending @drive_letter to the file is a work-around for issues
76
+ # when scanning Win VMs from Linux where the path returned from glob
77
+ # does not include the drive letter.
78
+ f = File.join(@drive_letter, f)
78
79
  processFile(File.dirname(f), File.basename(f), @xml.root)
79
80
  end
80
81
  rescue => err
81
- $log.info "scan_glob: Exception #{err} rescued"
82
+ $log.error "process_each_glob_file: Exception #{err} rescued"
82
83
  $log.debug err.backtrace.join("\n")
83
84
  end
84
85
 
@@ -98,7 +99,7 @@ class MD5deep
98
99
 
99
100
  def processDir(path, x, xmlNode)
100
101
  if x != "." && x != ".."
101
- currFile = File.join(@drive_letter, path, x)
102
+ currFile = File.join(path, x)
102
103
 
103
104
  begin
104
105
  if File.directory?(currFile)
@@ -117,7 +118,7 @@ class MD5deep
117
118
 
118
119
  def process_dir_as_file(path, x, xml_node)
119
120
  if x != "." && x != ".."
120
- curr_dir = File.join(@drive_letter, path, x)
121
+ curr_dir = File.join(path, x)
121
122
  if isDir?(curr_dir)
122
123
  xml_file_node = xml_node.add_element("file", "name" => x, "fqname" => curr_dir)
123
124
  stat_hash = {}
@@ -129,7 +130,7 @@ class MD5deep
129
130
 
130
131
  def processFile(path, x, xmlNode)
131
132
  if (@opts.exclude.include?(x) == false) && x[0..0] != "$"
132
- currFile = File.join(@drive_letter, path, x)
133
+ currFile = File.join(path, x)
133
134
 
134
135
  begin
135
136
  # unless File.directory?(currFile) then
@@ -226,10 +227,15 @@ class MD5deep
226
227
  # Create hash for requested digests
227
228
  digest = create_digest_hash
228
229
 
229
- fileName.seek(0, IO::SEEK_SET)
230
- # Loop over each digest and add the file contents
231
- while buf = fileName.read(10240000)
232
- digest.each_pair { |_k, v| v << buf }
230
+ begin
231
+ fileName.seek(0, IO::SEEK_SET)
232
+ # Loop over each digest and add the file contents
233
+ while (buf = fileName.read(10_240_000))
234
+ digest.each_pair { |_k, v| v << buf }
235
+ end
236
+ rescue => err
237
+ $log.error "Error #{err} reading file to calculate digest"
238
+ $log.debug err.backtrace.join("\n")
233
239
  end
234
240
  end
235
241
 
@@ -0,0 +1,15 @@
1
+ require 'delegate'
2
+ require 'tempfile'
3
+
4
+ class MiqTempfile < DelegateClass(Tempfile)
5
+ # TODO: share this definition with appliance console code.
6
+ MIQ_TMP_DIR = '/var/www/miq_tmp'.freeze
7
+
8
+ def initialize(basename, *options)
9
+ if File.directory?(MIQ_TMP_DIR)
10
+ super(Tempfile.new(basename, MIQ_TMP_DIR, *options))
11
+ else
12
+ super(Tempfile.new(basename, *options))
13
+ end
14
+ end
15
+ end
File without changes
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.5
4
+ version: 0.5.10
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-03-27 00:00:00.000000000 Z
11
+ date: 2020-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure-armrest
@@ -483,7 +483,6 @@ files:
483
483
  - lib/fs/xfs/short_form_directory_entry.rb
484
484
  - lib/fs/xfs/short_form_header.rb
485
485
  - lib/fs/xfs/superblock.rb
486
- - lib/lib/tasks/azure.rake
487
486
  - lib/manageiq-smartstate.rb
488
487
  - lib/manageiq/smartstate.rb
489
488
  - lib/manageiq/smartstate/util.rb
@@ -539,6 +538,8 @@ files:
539
538
  - lib/metadata/util/win32/remote-registry.rb
540
539
  - lib/metadata/util/win32/system_path_win.rb
541
540
  - lib/metadata/util/win32/versioninfo.rb
541
+ - lib/miq_tempfile.rb
542
+ - lib/tasks/azure.rake
542
543
  - log/.gitkeep
543
544
  - manageiq-smartstate.gemspec
544
545
  homepage: https://github.com/ManageIQ/manageiq-smartstate