manageiq-smartstate 0.2.2 → 0.2.3

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: f122bf39b0869a07d9112992d17ace268846c161
4
- data.tar.gz: 81497211b17140cf02bae4890da6ee495c6d5c3b
3
+ metadata.gz: 7a58411f04e6cb4f1f7465257a437c3e744a62c4
4
+ data.tar.gz: 223bf74877fb849f828ca38150ff29b31a44442a
5
5
  SHA512:
6
- metadata.gz: 25ce67a6278c3cb741e291afdaf8da88771e6ce0d07bf453ff6ae2daf5557aa95573679c77c41c4d304e32e0a384878e14dbf6c59c308dc0b8f198ae94113aba
7
- data.tar.gz: 9407613a050a3559a527e3f583513b6dff0c463367bb42ac1535ffbf8da32dd1977dd9bcbdde220bfde48606d7512cb1b5679015a538d9435bc3181edce06781
6
+ metadata.gz: f5a796988cb5966c6ba97c0de8e91601a65039a0f5f7d39fd8a4043019705363ff6daa8420563acf551c55da09a26e2f394ddda610ab84139a62bb4a3b028ca2
7
+ data.tar.gz: 6560d6d1386c9a206832cd697131364af6e602ca90b4873c5a223dfcf407d855ac9308b704f8906af660ba2ebdff86be8a8d3bce1300ad01da7ed1d2e3ee13e5
data/.travis.yml CHANGED
@@ -2,9 +2,8 @@ sudo: false
2
2
  cache: bundler
3
3
  language: ruby
4
4
  rvm:
5
- - 2.3.4
6
- - 2.4.1
7
- before_install: gem install bundler -v 1.14.4
5
+ - 2.3.1
6
+ - 2.4.2
8
7
  after_script: bundle exec codeclimate-test-reporter
9
8
  notifications:
10
9
  webhooks:
@@ -22,9 +22,9 @@ class MiqAzureVm < MiqVm
22
22
  os_disk = vm_obj.properties.storage_profile.os_disk
23
23
  if vm_obj.managed_disk?
24
24
  #
25
- # Use the EVM SNAPSHOT Added by the Provider
25
+ # Use the Smartstate SNAPSHOT Added by the Provider
26
26
  #
27
- @disk_name = os_disk.name + "__EVM__SSA__SNAPSHOT"
27
+ raise ArgumentError, "MiqAzureVm: missing required arg :snapshot for Managed Disk" unless (@disk_name = args[:snapshot])
28
28
  else
29
29
  #
30
30
  # Non-Managed Disk Snapshot handling
@@ -1,18 +1,11 @@
1
- require 'sys-uname'
2
-
3
1
  class VolMgrPlatformSupport
4
2
  def initialize(cfgFile, ost)
5
3
  $log.debug "Initializing VolMgrPlatformSupport" if $log
6
4
  @cfgFile = cfgFile
7
5
  @ost = ost
8
6
 
9
- if Sys::Platform::OS == :windows
10
- require "VolumeManager/VolMgrPlatformSupportWin"
11
- extend VolMgrPlatformSupportWin
12
- else
13
- require "VolumeManager/VolMgrPlatformSupportLinux"
14
- extend VolMgrPlatformSupportLinux
15
- end
7
+ require "VolumeManager/VolMgrPlatformSupportLinux"
8
+ extend VolMgrPlatformSupportLinux
16
9
  init
17
10
  end # def initialize
18
11
  end # class VolMgrPlatformSupport
@@ -1,23 +1,17 @@
1
1
  require 'sys-uname'
2
2
  require 'util/miq-system'
3
3
 
4
- if Sys::Platform::IMPL == :linux
5
- if MiqSystem.arch == :x86_64
6
- require 'linux_block_device'
7
- require 'disk/modules/RawBlockIO'
8
- end
4
+ if Sys::Platform::IMPL == :linux && MiqSystem.arch == :x86_64
5
+ require 'linux_block_device'
6
+ require 'disk/modules/RawBlockIO'
9
7
  end
10
8
 
11
9
  module MiqLargeFile
12
10
  def self.open(file_name, flags)
13
- case Sys::Platform::OS
14
- when :unix
15
- if Sys::Platform::IMPL == :linux
16
- return(RawBlockIO.new(file_name, flags)) if MiqLargeFileStat.new(file_name).blockdev?
17
- end
18
- return(MiqLargeFileOther.new(file_name, flags))
11
+ if Sys::Platform::IMPL == :linux && MiqLargeFileStat.new(file_name).blockdev?
12
+ RawBlockIO.new(file_name, flags)
19
13
  else
20
- return(MiqLargeFileOther.new(file_name, flags))
14
+ MiqLargeFileOther.new(file_name, flags)
21
15
  end
22
16
  end
23
17
 
@@ -5,6 +5,8 @@ require 'fs/ext4/superblock'
5
5
  require 'fs/ext4/directory_entry'
6
6
  require 'fs/ext4/directory'
7
7
 
8
+ require 'fs/MiqFsError'
9
+
8
10
  # Ext4 file system interface to MiqFS.
9
11
  module Ext4
10
12
  # Default directory cache size.
@@ -225,6 +227,10 @@ module Ext4
225
227
  begin
226
228
  dirObj = ifs_getDir(dir, miqfs)
227
229
  dirEnt = dirObj.nil? ? nil : dirObj.findEntry(fname)
230
+
231
+ rescue MiqFsDirectoryNotFound => err
232
+ dirEnt = nil
233
+
228
234
  rescue RuntimeError => err
229
235
  $log.error err.message.to_s if $log
230
236
  dirEnt = nil
@@ -268,7 +274,7 @@ module Ext4
268
274
  names.shift
269
275
 
270
276
  dir = ifs_getDirR(names, miqfs)
271
- raise "Directory '#{p}' not found" if dir.nil?
277
+ raise MiqFsDirectoryNotFound, p if dir.nil?
272
278
  dir
273
279
  end
274
280
 
@@ -1,15 +1,12 @@
1
+ require 'sys-uname'
2
+
1
3
  module RealFS
2
4
  attr_reader :guestOS
3
5
 
4
6
  def fs_init
5
- case Sys::Platform::IMPL
6
- when :mswin, :mingw
7
- self.fsType = "NTFS"
8
- @guestOS = "Windows"
9
- when :linux
7
+ if Sys::Platform::IMPL == :linux
10
8
  self.fsType = `df -lT / | tail -1 | awk '{ print $2 }'`
11
9
  @guestOS = "Linux"
12
- when :macosx
13
10
  end
14
11
  end
15
12
 
@@ -0,0 +1,11 @@
1
+ class MiqFsError < RuntimeError
2
+ end
3
+
4
+ class MiqFsDirectoryNotFound < MiqFsError
5
+ attr_accessor :dir
6
+
7
+ def initialize(dir)
8
+ super
9
+ @dir = dir
10
+ end
11
+ end
@@ -1,5 +1,6 @@
1
1
  require 'fs/iso9660/util'
2
2
 
3
+ require 'sys-uname'
3
4
  require 'binary_struct'
4
5
  require 'util/miq-unicode'
5
6
 
@@ -1,5 +1,3 @@
1
- require 'sys-uname'
2
-
3
1
  require 'binary_struct'
4
2
  require 'util/miq-unicode'
5
3
 
@@ -1,4 +1,3 @@
1
- require 'sys-uname'
2
1
  require 'fs/MiqFS/MiqFS'
3
2
  require 'metadata/util/win32/boot_info_win'
4
3
 
@@ -65,13 +64,10 @@ module WinMount
65
64
  private
66
65
 
67
66
  def normalizePath(p)
68
- if Sys::Platform::OS == :unix
69
- return p if p[1..1] == ':' # fully qualified path
70
- p = p.slice(1..-1) if p[0, 1] == '/'
71
- # On Linux, protect the drive letter with a '/', then remove it.
72
- return File.expand_path(p, '/' + @cwd).slice(1..-1)
73
- end
74
- File.expand_path(p, @cwd)
67
+ return p if p[1..1] == ':' # fully qualified path
68
+ p = p.slice(1..-1) if p[0, 1] == '/'
69
+ # On Linux, protect the drive letter with a '/', then remove it.
70
+ File.expand_path(p, '/' + @cwd).slice(1..-1)
75
71
  end
76
72
 
77
73
  #
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module Smartstate
3
- VERSION = "0.2.2".freeze
3
+ VERSION = "0.2.3".freeze
4
4
  end
5
5
  end
@@ -5,6 +5,7 @@ $log = Logger.new(File.expand_path("../../../../log/#{File.basename(__FILE__, ".
5
5
 
6
6
  require 'metadata/MIQExtract/MIQExtract'
7
7
  require 'util/miq-process'
8
+ require 'sys-uname'
8
9
 
9
10
  PROFILE_INIT = false
10
11
  PROFILE_EXTRACT = false
@@ -1,18 +1,11 @@
1
- require 'sys-uname'
2
-
3
1
  class VMPlatformMount
4
2
  def initialize(dInfo, ost)
5
3
  $log.debug "Initializing VMPlatformMount" if $log
6
4
  @dInfo = dInfo
7
5
  @ost = ost
8
6
 
9
- if Sys::Platform::OS == :windows
10
- require "metadata/VMMount/VMPlatformMountWin"
11
- extend VMPlatformMountWin
12
- else
13
- require "metadata/VMMount/VMPlatformMountLinux"
14
- extend VMPlatformMountLinux
15
- end
7
+ require "metadata/VMMount/VMPlatformMountLinux"
8
+ extend VMPlatformMountLinux
16
9
  init
17
10
  end # def initialize
18
11
  end # class VMPlatformMount
@@ -8,6 +8,7 @@ module XmlConfig
8
8
 
9
9
  xml_data = nil
10
10
  unless File.file?(filename)
11
+ require 'sys-uname'
11
12
  if Sys::Platform::IMPL == :linux
12
13
  begin
13
14
  # First check to see if the command is available
@@ -20,7 +20,7 @@ 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"
23
+ spec.add_dependency "azure-armrest", "~> 0.9"
24
24
  spec.add_dependency "binary_struct", "~> 2.1"
25
25
  spec.add_dependency "iniparse"
26
26
  spec.add_dependency "linux_block_device", "~>0.2.1"
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-smartstate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-18 00:00:00.000000000 Z
11
+ date: 2017-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure-armrest
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '0.9'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '0.9'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: binary_struct
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -311,7 +311,6 @@ files:
311
311
  - lib/VolumeManager/MiqVolumeManager.rb
312
312
  - lib/VolumeManager/VolMgrPlatformSupport.rb
313
313
  - lib/VolumeManager/VolMgrPlatformSupportLinux.rb
314
- - lib/VolumeManager/VolMgrPlatformSupportWin.rb
315
314
  - lib/VolumeManager/test/blockDevTest.rb
316
315
  - lib/VolumeManager/test/ldm.rb
317
316
  - lib/blackbox/VmBlackBox.rb
@@ -399,6 +398,7 @@ files:
399
398
  - lib/fs/MiqFS/modules/XFSProbe.rb
400
399
  - lib/fs/MiqFS/modules/ZFSProbe.rb
401
400
  - lib/fs/MiqFS/test.rb
401
+ - lib/fs/MiqFsError.rb
402
402
  - lib/fs/MiqFsUtil.rb
403
403
  - lib/fs/MiqMountManager.rb
404
404
  - lib/fs/MiqNativeMountManager.rb
@@ -524,7 +524,6 @@ files:
524
524
  - lib/metadata/VMMount/VMMount.rb
525
525
  - lib/metadata/VMMount/VMPlatformMount.rb
526
526
  - lib/metadata/VMMount/VMPlatformMountLinux.rb
527
- - lib/metadata/VMMount/VMPlatformMountWin.rb
528
527
  - lib/metadata/VmConfig/GetNativeCfg.rb
529
528
  - lib/metadata/VmConfig/VmConfig.rb
530
529
  - lib/metadata/VmConfig/cfgConfig.rb
@@ -584,7 +583,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
584
583
  version: '0'
585
584
  requirements: []
586
585
  rubyforge_project:
587
- rubygems_version: 2.6.11
586
+ rubygems_version: 2.6.12
588
587
  signing_key:
589
588
  specification_version: 4
590
589
  summary: ManageIQ SmartState Analysis
@@ -1,17 +0,0 @@
1
- module VolMgrPlatformSupportWin
2
- def init
3
- true
4
- end
5
-
6
- def setDiskFlags(_dInfo)
7
- true
8
- end
9
-
10
- def preMount
11
- true
12
- end
13
-
14
- def postMount
15
- true
16
- end
17
- end # module VolMgrPlatformSupportWin
@@ -1,13 +0,0 @@
1
- module VMPlatformMountWin
2
- def init
3
- true
4
- end
5
-
6
- def preMount
7
- true
8
- end
9
-
10
- def postMount
11
- true
12
- end
13
- end # module VMPlatformMountWin