manageiq-smartstate 0.2.9 → 0.2.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: 6eb97c180a24d90e1c1ddf4967219d6a4c6dc454
4
- data.tar.gz: 045130c52ec03cdbf3df0972bda3b1b2dd22633f
3
+ metadata.gz: dd6c8e7fc62f55e3496569ccfb9b7154401a3f1c
4
+ data.tar.gz: aa6b6c308e48258d4ce2f4a502907d1747332980
5
5
  SHA512:
6
- metadata.gz: abd7b68aab062cc0af0f1afc108a614d0eaad41990e4899e71eef0d420385b4d3ae2a1156bde5deda1a12a77a242109af227e3a24fa222d13b2e53ba38569139
7
- data.tar.gz: e8e5ce33b6b7859b9698354e407e4ec6f93f8a64e44d458f90c96f41ea864cd71b5329d80b2f29357185c3cd8d80acd4d2f42afcd899f35147f0bc72b120102f
6
+ metadata.gz: e1ef8e9e1f61e45418d4fef638e4b021a0e5e80b3e6701af800f46b6f695d316cfc23ea3bc10526c623b781961d22a44fe7a8691ff76e33cb833b8d8503176da
7
+ data.tar.gz: 242e3b1c155fca702a7fc3987c169299bcd240fb2012adc87f6ea778d340f257ba80eceebf37e8919235f6d48ad9bfd2011f07af5172e3ef606700e009450e4a
@@ -1,6 +1,7 @@
1
1
  # encoding: US-ASCII
2
2
 
3
3
  require 'util/miq_winrm'
4
+ require 'util/miq-exception'
4
5
  require 'Scvmm/miq_scvmm_parse_powershell'
5
6
  require 'base64'
6
7
  require 'securerandom'
@@ -50,7 +51,7 @@ STAT_EOL
50
51
  file_size, stderr = @parser.parse_single_powershell_value(run_correct_powershell(stat_script))
51
52
 
52
53
  if @network && stderr.include?("RegisterTaskDefinition")
53
- raise "Unable to obtain virtual disk size for #{vm_disk}. Check Hyper-V Host Domain Credentials"
54
+ raise MiqException::MiqInvalidCredentialsError, "Unable to obtain virtual disk size for #{vm_disk}. Check Hyper-V Host Domain Credentials."
54
55
  end
55
56
  OPEN_ERRORS.each { |error| raise "Unable to obtain virtual disk size for #{vm_disk}" if stderr.include?(error) }
56
57
  @file_size = file_size.to_i
@@ -1,4 +1,5 @@
1
1
  module DiskProbe
2
+ require 'util/miq-exception'
2
3
  MODDIR = File.expand_path(File.join(File.dirname(__FILE__), "modules"))
3
4
 
4
5
  PROBE_FILES = Dir.glob(File.join(MODDIR, "*Probe.rb*"))
@@ -30,6 +31,9 @@ module DiskProbe
30
31
  require_relative "modules/#{mod}"
31
32
  return Object.const_get(mod)
32
33
  end
34
+ rescue MiqException::MiqInvalidCredentialsError => err
35
+ $log.error "MIQ(DiskProbe-getDiskMod) [#{pmod.chomp("Probe")}-#{mod}] for [#{fname}]: #{err}"
36
+ raise err
33
37
  rescue => err
34
38
  $log.warn "MIQ(DiskProbe-getDiskMod) [#{pmod.chomp("Probe")}-#{mod}] for [#{fname}]: #{err}"
35
39
  end
@@ -1,19 +1,13 @@
1
1
  # encoding: US-ASCII
2
2
 
3
3
  require 'disk/modules/MSCommon'
4
+ require 'disk/modules/miq_disk_common'
4
5
 
5
6
  module MSVSDiffDisk
6
7
  def d_init
7
8
  self.diskType = "MSVS Differencing"
8
9
  self.blockSize = MSCommon::SECTOR_LENGTH
9
- if dInfo.mountMode.nil? || dInfo.mountMode == "r"
10
- dInfo.mountMode = "r"
11
- fileMode = "r"
12
- elsif dInfo.mountMode == "rw"
13
- fileMode = "r+"
14
- else
15
- raise "Unrecognized mountMode: #{dInfo.mountMode}"
16
- end
10
+ fileMode = MiqDiskCommon.file_mode(dInfo)
17
11
  if dInfo.hyperv_connection
18
12
  @hyperv_connection = dInfo.hyperv_connection
19
13
  @ms_disk_file = MSCommon.connect_to_hyperv(dInfo)
@@ -1,17 +1,11 @@
1
1
  require 'disk/modules/MSCommon'
2
+ require 'disk/modules/miq_disk_common'
2
3
 
3
4
  module MSVSDynamicDisk
4
5
  def d_init
5
6
  self.diskType = "MSVS Dynamic"
6
7
  self.blockSize = MSCommon::SECTOR_LENGTH
7
- if dInfo.mountMode.nil? || dInfo.mountMode == "r"
8
- dInfo.mountMode = "r"
9
- fileMode = "r"
10
- elsif dInfo.mountMode == "rw"
11
- fileMode = "r+"
12
- else
13
- raise "Unrecognized mountMode: #{dInfo.mountMode}"
14
- end
8
+ fileMode = MiqDiskCommon.file_mode(dInfo)
15
9
  @ms_disk_file = if dInfo.hyperv_connection
16
10
  MSCommon.connect_to_hyperv(dInfo)
17
11
  else
@@ -1,18 +1,12 @@
1
1
  require 'disk/modules/MiqLargeFile'
2
+ require 'disk/modules/miq_disk_common'
2
3
 
3
4
  module MSVSFixedDisk
4
5
  def d_init
5
6
  @diskType = "MSVSFixed"
6
7
  @blockSize = 512
7
8
 
8
- if dInfo.mountMode.nil? || dInfo.mountMode == "r"
9
- dInfo.mountMode = "r"
10
- fileMode = "r"
11
- elsif dInfo.mountMode == "rw"
12
- fileMode = "r+"
13
- else
14
- raise "Unrecognized mountMode: #{dInfo.mountMode}"
15
- end
9
+ fileMode = MiqDiskCommon.file_mode
16
10
 
17
11
  if dInfo.hyperv_connection
18
12
  @ms_flat_disk_file = MSCommon.connect_to_hyperv(dInfo)
@@ -1,18 +1,12 @@
1
1
  require 'disk/modules/MiqLargeFile'
2
+ require 'disk/modules/miq_disk_common'
2
3
 
3
4
  module RawDisk
4
5
  def d_init
5
6
  self.diskType = "Raw"
6
7
  self.blockSize = 512
7
8
 
8
- if dInfo.mountMode.nil? || dInfo.mountMode == "r"
9
- dInfo.mountMode = "r"
10
- fileMode = "r"
11
- elsif dInfo.mountMode == "rw"
12
- fileMode = "r+"
13
- else
14
- raise "Unrecognized mountMode: #{dInfo.mountMode}"
15
- end
9
+ fileMode = MiqDiskCommon.file_mode(dInfo)
16
10
 
17
11
  @dOffset = dInfo.offset
18
12
  @rawDisk_file = MiqLargeFile.open(dInfo.fileName, fileMode)
@@ -1,4 +1,5 @@
1
1
  require 'disk/modules/MiqLargeFile'
2
+ require 'disk/modules/miq_disk_common'
2
3
  require 'binary_struct'
3
4
  require 'memory_buffer'
4
5
 
@@ -24,14 +25,7 @@ module VMWareCowdDisk
24
25
  def d_init
25
26
  self.diskType = "VMWare CopyOnWrite"
26
27
  self.blockSize = 512
27
- if dInfo.mountMode.nil? || dInfo.mountMode == "r"
28
- dInfo.mountMode = "r"
29
- fileMode = "r"
30
- elsif dInfo.mountMode == "rw"
31
- fileMode = "r+"
32
- else
33
- raise "Unrecognized mountMode: #{dInfo.mountMode}"
34
- end
28
+ fileMode = MiqDiskCommon.file_mode(dInfo)
35
29
  @dParent = @dInfo.parent
36
30
 
37
31
  @vmwareCowDisk_file = MiqLargeFile.open(dInfo.fileName, fileMode)
@@ -1,4 +1,5 @@
1
1
  require 'disk/modules/MiqLargeFile'
2
+ require 'disk/modules/miq_disk_common'
2
3
  require 'binary_struct'
3
4
  require 'memory_buffer'
4
5
 
@@ -24,14 +25,7 @@ module VMWareSparseDisk
24
25
  def d_init
25
26
  self.diskType = "VMWare Sparse"
26
27
  self.blockSize = 512
27
- if dInfo.mountMode.nil? || dInfo.mountMode == "r"
28
- dInfo.mountMode = "r"
29
- fileMode = "r"
30
- elsif dInfo.mountMode == "rw"
31
- fileMode = "r+"
32
- else
33
- raise "Unrecognized mountMode: #{dInfo.mountMode}"
34
- end
28
+ fileMode = MiqDiskCommon.file_mode(dInfo)
35
29
  @vmwareSparseDisk_file = MiqLargeFile.open(dInfo.fileName, fileMode)
36
30
  buf = @vmwareSparseDisk_file.read(SIZEOF_SPARSE_EXTENT_HEADER)
37
31
  @sparseHeader = OpenStruct.new(SPARSE_EXTENT_HEADER.decode(buf))
@@ -0,0 +1,11 @@
1
+ module MiqDiskCommon
2
+ def self.file_mode(d_info)
3
+ if d_info.mountMode.nil? || d_info.mountMode == "r"
4
+ d_info.mountMode = "r"
5
+ return "r"
6
+ elsif d_info.mountMode == "rw"
7
+ return "r+"
8
+ end
9
+ raise "Unrecognized mountMode: #{d_info.mountMode}"
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module Smartstate
3
- VERSION = "0.2.9".freeze
3
+ VERSION = "0.2.10".freeze
4
4
  end
5
5
  end
@@ -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", "~> 0.9.5"
23
+ spec.add_dependency "azure-armrest", "~> 0.9.6"
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,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.9
4
+ version: 0.2.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: 2018-02-27 00:00:00.000000000 Z
11
+ date: 2018-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure-armrest
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.9.5
19
+ version: 0.9.6
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.9.5
26
+ version: 0.9.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: binary_struct
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -356,6 +356,7 @@ files:
356
356
  - lib/disk/modules/VixDiskMod.rb
357
357
  - lib/disk/modules/VixDiskProbe.rb
358
358
  - lib/disk/modules/miq_disk_cache.rb
359
+ - lib/disk/modules/miq_disk_common.rb
359
360
  - lib/disk/modules/miq_dummy_disk.rb
360
361
  - lib/disk/modules/vhdx_bat_entry.rb
361
362
  - lib/disk/test.rb