manageiq-smartstate 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -3
- data/lib/MiqVm/MiqLocalVm.rb +3 -14
- data/lib/MiqVm/MiqVm.rb +3 -11
- data/lib/MiqVm/test/camcorder_fleece_test.rb +3 -11
- data/lib/MiqVm/test/localVm.rb +3 -10
- data/lib/MiqVm/test/partitionAlignmentCheck.rb +2 -11
- data/lib/MiqVm/test/remoteVm.rb +2 -11
- data/lib/MiqVm/test/rhevmNfsTest.rb +3 -11
- data/lib/MiqVm/test/rhevmNfsTest2.rb +3 -11
- data/lib/MiqVm/test/rhevmTest.rb +3 -11
- data/lib/Scvmm/test/miq_hyperv_disk_test.rb +3 -13
- data/lib/Scvmm/test/miq_scvmm_vm_ssa_info_test.rb +3 -13
- data/lib/VmLocalDiskAccess/test/localCfg.rb +3 -13
- data/lib/VolumeManager/MiqLdm.rb +3 -13
- data/lib/VolumeManager/test/blockDevTest.rb +3 -11
- data/lib/VolumeManager/test/ldm.rb +3 -10
- data/lib/disk/camcorder_test.rb +3 -13
- data/lib/disk/test.rb +3 -13
- data/lib/fs/MetakitFS/test/MkSelectFiles.rb +4 -14
- data/lib/fs/MetakitFS/test/mk2vmdk.rb +3 -13
- data/lib/fs/MiqNativeMountManager.rb +3 -13
- data/lib/fs/test/camcorder_fs_test.rb +3 -13
- data/lib/fs/test/copyTest.rb +5 -15
- data/lib/fs/test/fsTest.rb +3 -13
- data/lib/fs/test/updateTest.rb +5 -15
- data/lib/manageiq/smartstate/util.rb +0 -6
- data/lib/manageiq/smartstate/version.rb +1 -1
- data/lib/metadata/MIQExtract/MIQExtract.rb +0 -1
- data/lib/metadata/MIQExtract/test/extractTest.rb +3 -11
- data/lib/metadata/MIQExtract/test/full_extract_test.rb +3 -5
- data/lib/metadata/ScanProfile/ScanProfilesBase.rb +0 -1
- data/lib/metadata/VmConfig/test/GetVMwareCfgTest.rb +3 -3
- data/lib/metadata/linux/LinuxUsers.rb +3 -11
- data/lib/metadata/util/md5deep.rb +2 -3
- data/lib/metadata/util/win32/Win32Accounts.rb +0 -1
- data/lib/metadata/util/win32/Win32Services.rb +0 -1
- data/lib/metadata/util/win32/Win32Software.rb +0 -1
- data/lib/metadata/util/win32/Win32System.rb +0 -1
- data/log/.gitkeep +0 -0
- data/manageiq-smartstate.gemspec +0 -1
- metadata +3 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f122bf39b0869a07d9112992d17ace268846c161
|
4
|
+
data.tar.gz: 81497211b17140cf02bae4890da6ee495c6d5c3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25ce67a6278c3cb741e291afdaf8da88771e6ce0d07bf453ff6ae2daf5557aa95573679c77c41c4d304e32e0a384878e14dbf6c59c308dc0b8f198ae94113aba
|
7
|
+
data.tar.gz: 9407613a050a3559a527e3f583513b6dff0c463367bb42ac1535ffbf8da32dd1977dd9bcbdde220bfde48606d7512cb1b5679015a538d9435bc3181edce06781
|
data/.gitignore
CHANGED
data/lib/MiqVm/MiqLocalVm.rb
CHANGED
@@ -23,20 +23,9 @@ class MiqLocalVm < MiqVm
|
|
23
23
|
end # class MiqVm
|
24
24
|
|
25
25
|
if __FILE__ == $0
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
class ConsoleFormatter < Log4r::Formatter
|
31
|
-
def format(event)
|
32
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
toplog = Log4r::Logger.new 'toplog'
|
37
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
38
|
-
toplog.add 'err_console'
|
39
|
-
$log = toplog if $log.nil?
|
26
|
+
require 'logger'
|
27
|
+
$log = Logger.new(STDERR)
|
28
|
+
$log.level = Logger::DEBUG
|
40
29
|
|
41
30
|
vm = MiqLocalVm.new
|
42
31
|
|
data/lib/MiqVm/MiqVm.rb
CHANGED
@@ -207,7 +207,6 @@ class MiqVm
|
|
207
207
|
end # class MiqVm
|
208
208
|
|
209
209
|
if __FILE__ == $0
|
210
|
-
require 'log4r'
|
211
210
|
require 'metadata/util/win32/boot_info_win'
|
212
211
|
|
213
212
|
# vmDir = File.join(ENV.fetch("HOME", '.'), 'VMs')
|
@@ -217,16 +216,9 @@ if __FILE__ == $0
|
|
217
216
|
targetLv = "rpolv2"
|
218
217
|
rootLv = "LogVol00"
|
219
218
|
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
end
|
224
|
-
end
|
225
|
-
|
226
|
-
toplog = Log4r::Logger.new 'toplog'
|
227
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
228
|
-
toplog.add 'err_console'
|
229
|
-
$log = toplog if $log.nil?
|
219
|
+
require 'logger'
|
220
|
+
$log = Logger.new(STDERR)
|
221
|
+
$log.level = Logger::DEBUG
|
230
222
|
|
231
223
|
#
|
232
224
|
# *** Test start
|
@@ -1,19 +1,11 @@
|
|
1
1
|
require 'manageiq-gems-pending'
|
2
2
|
require 'openssl' # Required for 'Digest' in camcorder (< Ruby 2.1)
|
3
3
|
require 'camcorder'
|
4
|
-
require 'log4r'
|
5
4
|
require 'MiqVm/MiqVm'
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
toplog = Log4r::Logger.new 'toplog'
|
14
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
15
|
-
toplog.add 'err_console'
|
16
|
-
$log = toplog if $log.nil?
|
6
|
+
require 'logger'
|
7
|
+
$log = Logger.new(STDERR)
|
8
|
+
$log.level = Logger::DEBUG
|
17
9
|
|
18
10
|
#
|
19
11
|
# Path to RAW disk image.
|
data/lib/MiqVm/test/localVm.rb
CHANGED
@@ -1,17 +1,10 @@
|
|
1
1
|
require 'manageiq-gems-pending'
|
2
2
|
require 'ostruct'
|
3
|
-
require 'log4r'
|
4
3
|
require 'MiqVm/MiqVm'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
$log = Log4r::Logger.new 'toplog'
|
13
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
14
|
-
$log.add 'err_console'
|
5
|
+
require 'logger'
|
6
|
+
$log = Logger.new(STDERR)
|
7
|
+
$log.level = Logger::DEBUG
|
15
8
|
|
16
9
|
VHD = raise "Please define VHD"
|
17
10
|
diskid = "ide0:0"
|
@@ -1,19 +1,10 @@
|
|
1
1
|
require 'manageiq-gems-pending'
|
2
2
|
require 'ostruct'
|
3
|
-
require 'log4r'
|
4
3
|
require 'MiqVm/MiqVm'
|
5
4
|
require 'VmwareWebService/MiqVim'
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
toplog = Log4r::Logger.new 'toplog'
|
14
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::INFO, :formatter => ConsoleFormatter)
|
15
|
-
toplog.add 'err_console'
|
16
|
-
$vim_log = $log = toplog if $log.nil?
|
6
|
+
require 'logger'
|
7
|
+
$vim_log = $log = Logger.new(STDERR)
|
17
8
|
|
18
9
|
SERVER = raise "please define SERVER"
|
19
10
|
USERNAME = raise "please define USERNAME"
|
data/lib/MiqVm/test/remoteVm.rb
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
require 'manageiq-gems-pending'
|
2
2
|
require 'ostruct'
|
3
|
-
require 'log4r'
|
4
3
|
require 'MiqVm/MiqVm'
|
5
4
|
require 'VMwareWebService/MiqVim'
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
10
|
-
end
|
11
|
-
end
|
6
|
+
require 'logger'
|
7
|
+
$vim_log = $log = Logger.new(STDERR)
|
12
8
|
|
13
9
|
SERVER = raise "please define SERVER"
|
14
10
|
PORT = 443
|
@@ -17,11 +13,6 @@ USERNAME = raise "please define USERNAME"
|
|
17
13
|
PASSWORD = raise "please define PASSWORD"
|
18
14
|
TARGET_VM = raise "please define TARGET_VM"
|
19
15
|
|
20
|
-
toplog = Log4r::Logger.new 'toplog'
|
21
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::INFO, :formatter => ConsoleFormatter)
|
22
|
-
toplog.add 'err_console'
|
23
|
-
$vim_log = $log = toplog if $log.nil?
|
24
|
-
|
25
16
|
vim = MiqVim.new(SERVER, USERNAME, PASSWORD)
|
26
17
|
|
27
18
|
begin
|
@@ -3,20 +3,12 @@
|
|
3
3
|
#
|
4
4
|
|
5
5
|
require 'manageiq-gems-pending'
|
6
|
-
require 'log4r'
|
7
6
|
require 'ostruct'
|
8
7
|
require 'MiqVm/MiqVm'
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
toplog = Log4r::Logger.new 'toplog'
|
17
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
18
|
-
toplog.add 'err_console'
|
19
|
-
$log = toplog if $log.nil?
|
9
|
+
require 'logger'
|
10
|
+
$log = Logger.new(STDERR)
|
11
|
+
$log.level = Logger::DEBUG
|
20
12
|
|
21
13
|
DDIR = "/mnt/vm/7fd0b9b2-e362-11e2-97b7-001a4aa8fcea/rhev/data-center/773f2ddf-7765-42fc-85d6-673b718541cd/aa7e70e5-40d0-43e2-a605-92ce6ba652a8/images/19449cf8-1905-4b8a-b45a-e845a693a3df"
|
22
14
|
BASE_FILE = "#{DDIR}/903306be-f676-4005-a813-daa6d7a6c33f"
|
@@ -3,20 +3,12 @@
|
|
3
3
|
#
|
4
4
|
|
5
5
|
require 'manageiq-gems-pending'
|
6
|
-
require 'log4r'
|
7
6
|
require 'ostruct'
|
8
7
|
require 'MiqVm/MiqVm'
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
toplog = Log4r::Logger.new 'toplog'
|
17
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
18
|
-
toplog.add 'err_console'
|
19
|
-
$log = toplog if $log.nil?
|
9
|
+
require 'logger'
|
10
|
+
$log = Logger.new(STDERR)
|
11
|
+
$log.level = Logger::DEBUG
|
20
12
|
|
21
13
|
DDIR = "/mnt/vm/7fd0b9b2-e362-11e2-97b7-001a4aa8fcea/rhev/data-center/773f2ddf-7765-42fc-85d6-673b718541cd/aa7e70e5-40d0-43e2-a605-92ce6ba652a8/images/19449cf8-1905-4b8a-b45a-e845a693a3df"
|
22
14
|
BASE_FILE = "#{DDIR}/903306be-f676-4005-a813-daa6d7a6c33f"
|
data/lib/MiqVm/test/rhevmTest.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'manageiq-gems-pending'
|
2
|
-
require 'log4r'
|
3
2
|
require 'ostruct'
|
4
3
|
require 'MiqVm/MiqVm'
|
5
4
|
require 'ovirt'
|
@@ -13,16 +12,9 @@ RHEVM_USERNAME = raise "please define RHEVM_USERNAME"
|
|
13
12
|
RHEVM_PASSWORD = raise "please define RHEVM_PASSWORD"
|
14
13
|
VM_NAME = raise "please define VM_NAME"
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
toplog = Log4r::Logger.new 'toplog'
|
23
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
24
|
-
toplog.add 'err_console'
|
25
|
-
$log = toplog if $log.nil?
|
15
|
+
require 'logger'
|
16
|
+
$log = Logger.new(STDERR)
|
17
|
+
$log.level = Logger::DEBUG
|
26
18
|
|
27
19
|
begin
|
28
20
|
|
@@ -1,20 +1,10 @@
|
|
1
1
|
require 'manageiq-gems-pending'
|
2
2
|
require 'rubygems'
|
3
|
-
require 'log4r'
|
4
3
|
require 'Scvmm/miq_hyperv_disk'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
class ConsoleFormatter < Log4r::Formatter
|
10
|
-
def format(event)
|
11
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
$log = Log4r::Logger.new 'toplog'
|
16
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
17
|
-
$log.add 'err_console'
|
5
|
+
require 'logger'
|
6
|
+
$log = Logger.new(STDERR)
|
7
|
+
$log.level = Logger::DEBUG
|
18
8
|
|
19
9
|
HOST = raise "Please define SERVERNAME"
|
20
10
|
PORT = raise "Please define PORT"
|
@@ -1,20 +1,10 @@
|
|
1
1
|
require 'manageiq-gems-pending'
|
2
2
|
require 'rubygems'
|
3
|
-
require 'log4r'
|
4
3
|
require 'Scvmm/miq_scvmm_vm_ssa_info'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
class ConsoleFormatter < Log4r::Formatter
|
10
|
-
def format(event)
|
11
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
$log = Log4r::Logger.new 'toplog'
|
16
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
17
|
-
$log.add 'err_console'
|
5
|
+
require 'logger'
|
6
|
+
$log = Logger.new(STDERR)
|
7
|
+
$log.level = Logger::DEBUG
|
18
8
|
|
19
9
|
HOST = raise "Please define SERVERNAME"
|
20
10
|
PORT = raise "Please define PORT"
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'log4r'
|
2
1
|
require 'util/miq-xml'
|
3
2
|
require 'util/runcmd'
|
4
3
|
require 'metadata/VmConfig/VmConfig'
|
@@ -44,18 +43,9 @@ module MiqNativeMountManager
|
|
44
43
|
end # module MiqNativeMountManager
|
45
44
|
|
46
45
|
if __FILE__ == $0
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
class ConsoleFormatter < Log4r::Formatter
|
51
|
-
def format(event)
|
52
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
53
|
-
end
|
54
|
-
end
|
55
|
-
$log = Log4r::Logger.new 'toplog'
|
56
|
-
$log.level = Log4r::DEBUG
|
57
|
-
Log4r::StderrOutputter.new('err_console', :formatter => ConsoleFormatter)
|
58
|
-
$log.add 'err_console'
|
46
|
+
require 'logger'
|
47
|
+
$log = Logger.new(STDERR)
|
48
|
+
$log.level = Logger::DEBUG
|
59
49
|
|
60
50
|
puts "Log debug?: #{$log.debug?}"
|
61
51
|
|
data/lib/VolumeManager/MiqLdm.rb
CHANGED
@@ -443,22 +443,12 @@ if __FILE__ == $0
|
|
443
443
|
$: << File.join(SD, "../disk")
|
444
444
|
|
445
445
|
require 'rubygems'
|
446
|
-
require 'log4r'
|
447
446
|
require 'ostruct'
|
448
447
|
require 'MiqDisk'
|
449
448
|
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
class ConsoleFormatter < Log4r::Formatter
|
454
|
-
def format(event)
|
455
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
456
|
-
end
|
457
|
-
end
|
458
|
-
$log = Log4r::Logger.new 'toplog'
|
459
|
-
$log.level = Log4r::DEBUG
|
460
|
-
Log4r::StderrOutputter.new('err_console', :formatter => ConsoleFormatter)
|
461
|
-
$log.add 'err_console'
|
449
|
+
require 'logger'
|
450
|
+
$log = Logger.new(STDERR)
|
451
|
+
$log.level = Logger::DEBUG
|
462
452
|
|
463
453
|
# DISK = "/Volumes/WDpassport/Virtual Machines/cn071vcce130/cn071vcce130_3.vmdk"
|
464
454
|
# DISK = "/Volumes/WDpassport/Virtual Machines/cn071vcce130/cn071vcce130.vmdk"
|
@@ -1,20 +1,12 @@
|
|
1
1
|
require 'manageiq-gems-pending'
|
2
2
|
require 'ostruct'
|
3
|
-
require 'log4r'
|
4
3
|
|
5
4
|
require 'disk/MiqDisk'
|
6
5
|
require 'VolumeManager/MiqVolumeManager'
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
toplog = Log4r::Logger.new 'toplog'
|
15
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
16
|
-
toplog.add 'err_console'
|
17
|
-
$vim_log = $log = toplog if $log.nil?
|
7
|
+
require 'logger'
|
8
|
+
$vim_log = $log = Logger.new(STDERR)
|
9
|
+
$log.level = Logger::DEBUG
|
18
10
|
|
19
11
|
begin
|
20
12
|
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'manageiq-gems-pending'
|
2
|
-
require 'log4r'
|
3
2
|
require 'ostruct'
|
4
3
|
require 'more_core_extensions/core_ext/object/blank'
|
5
4
|
require 'metadata/VmConfig/VmConfig'
|
@@ -11,15 +10,9 @@ require 'VMwareWebService/MiqVimBroker'
|
|
11
10
|
SRC_VM = raise "please define"
|
12
11
|
vmCfg = "/Volumes/WDpassport/Virtual Machines/MIQAppliance-win2008x86/Win2008x86.vmx"
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
18
|
-
end
|
19
|
-
$log = Log4r::Logger.new 'toplog'
|
20
|
-
$log.level = Log4r::DEBUG
|
21
|
-
Log4r::StderrOutputter.new('err_console', :formatter => ConsoleFormatter)
|
22
|
-
$log.add 'err_console'
|
13
|
+
require 'logger'
|
14
|
+
$log = Logger.new(STDERR)
|
15
|
+
$log.level = Logger::DEBUG
|
23
16
|
|
24
17
|
vm = nil
|
25
18
|
vim = nil
|
data/lib/disk/camcorder_test.rb
CHANGED
@@ -1,22 +1,12 @@
|
|
1
1
|
require 'openssl' # Required for 'Digest' in camcorder (< Ruby 2.1)?
|
2
2
|
require 'camcorder'
|
3
|
-
require 'log4r'
|
4
3
|
require 'ostruct'
|
5
4
|
require 'disk/MiqDisk'
|
6
5
|
require 'disk/modules/MiqLargeFile'
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
class ConsoleFormatter < Log4r::Formatter
|
12
|
-
def format(event)
|
13
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
$log = Log4r::Logger.new 'toplog'
|
17
|
-
$log.level = Log4r::DEBUG
|
18
|
-
Log4r::StderrOutputter.new('err_console', :formatter => ConsoleFormatter)
|
19
|
-
$log.add 'err_console'
|
7
|
+
require 'logger'
|
8
|
+
$log = Logger.new(STDERR)
|
9
|
+
$log.level = Logger::DEBUG
|
20
10
|
|
21
11
|
#
|
22
12
|
# Path to RAW disk image.
|
data/lib/disk/test.rb
CHANGED
@@ -1,20 +1,10 @@
|
|
1
1
|
begin
|
2
|
-
require 'log4r'
|
3
2
|
require 'ostruct'
|
4
3
|
require 'disk/MiqDisk'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
class ConsoleFormatter < Log4r::Formatter
|
10
|
-
def format(event)
|
11
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
$log = Log4r::Logger.new 'toplog'
|
15
|
-
$log.level = Log4r::DEBUG
|
16
|
-
Log4r::StderrOutputter.new('err_console', :formatter => ConsoleFormatter)
|
17
|
-
$log.add 'err_console'
|
5
|
+
require 'logger'
|
6
|
+
$log = Logger.new(STDERR)
|
7
|
+
$log.level = Logger::DEBUG
|
18
8
|
|
19
9
|
diskInfo = OpenStruct.new
|
20
10
|
diskInfo.rawDisk = true
|
@@ -1,22 +1,12 @@
|
|
1
|
-
require 'log4r'
|
2
1
|
require 'fs/MiqFsUtil'
|
3
2
|
require 'fs/MiqFS/MiqFS'
|
4
3
|
require 'fs/MetakitFS/MetakitFS'
|
5
4
|
require 'fs/MiqFS/modules/LocalFS'
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
$
|
11
|
-
class ConsoleFormatter < Log4r::Formatter
|
12
|
-
def format(event)
|
13
|
-
t = Time.now
|
14
|
-
"#{t.hour}:#{t.min}:#{t.sec}: " + (event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
$log = Log4r::Logger.new 'toplog'
|
18
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
19
|
-
$log.add 'err_console'
|
6
|
+
require 'logger'
|
7
|
+
STDERR.sync = true
|
8
|
+
$log = Logger.new(STDERR)
|
9
|
+
$log.level = Logger::DEBUG
|
20
10
|
|
21
11
|
dobj = OpenStruct.new
|
22
12
|
dobj.mkfile = ARGV[1]
|
@@ -1,22 +1,12 @@
|
|
1
|
-
require 'log4r'
|
2
1
|
require 'ostruct'
|
3
2
|
require 'disk/MiqDisk'
|
4
3
|
|
5
4
|
VMDK = "/Volumes/WDpassport/Virtual Machines/Red Hat Linux.vmwarevm/payload2.vmdk"
|
6
5
|
MKFILE = "rawmkfs"
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
class ConsoleFormatter < Log4r::Formatter
|
12
|
-
def format(event)
|
13
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
$log = Log4r::Logger.new 'toplog'
|
17
|
-
$log.level = Log4r::DEBUG
|
18
|
-
Log4r::StderrOutputter.new('err_console', :formatter => ConsoleFormatter)
|
19
|
-
$log.add 'err_console'
|
7
|
+
require 'logger'
|
8
|
+
$log = Logger.new(STDERR)
|
9
|
+
$log.level = Logger::DEBUG
|
20
10
|
|
21
11
|
diskInfo = OpenStruct.new
|
22
12
|
diskInfo.mountMode = "rw"
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'log4r'
|
2
1
|
require 'metadata/VmConfig/GetNativeCfg'
|
3
2
|
require 'VolumeManager/MiqNativeVolumeManager'
|
4
3
|
require 'fs/MiqMountManager'
|
@@ -13,18 +12,9 @@ module MiqNativeMountManager
|
|
13
12
|
end # module MiqNativeMountManager
|
14
13
|
|
15
14
|
if __FILE__ == $0
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
class ConsoleFormatter < Log4r::Formatter
|
20
|
-
def format(event)
|
21
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
22
|
-
end
|
23
|
-
end
|
24
|
-
$log = Log4r::Logger.new 'toplog'
|
25
|
-
$log.level = Log4r::DEBUG
|
26
|
-
Log4r::StderrOutputter.new('err_console', :formatter => ConsoleFormatter)
|
27
|
-
$log.add 'err_console'
|
15
|
+
require 'logger'
|
16
|
+
$log = Logger.new(STDERR)
|
17
|
+
$log.level = Logger::DEBUG
|
28
18
|
|
29
19
|
puts "Log debug?: #{$log.debug?}"
|
30
20
|
|
@@ -1,24 +1,14 @@
|
|
1
1
|
require 'manageiq-gems-pending'
|
2
2
|
require 'openssl' # Required for 'Digest' in camcorder (< Ruby 2.1)
|
3
3
|
require 'camcorder'
|
4
|
-
require 'log4r'
|
5
4
|
require 'ostruct'
|
6
5
|
require 'disk/MiqDisk'
|
7
6
|
require 'fs/MiqFS/MiqFS'
|
8
7
|
require 'disk/modules/MiqLargeFile'
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
class ConsoleFormatter < Log4r::Formatter
|
14
|
-
def format(event)
|
15
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
$log = Log4r::Logger.new 'toplog'
|
19
|
-
$log.level = Log4r::DEBUG
|
20
|
-
Log4r::StderrOutputter.new('err_console', :formatter => ConsoleFormatter)
|
21
|
-
$log.add 'err_console'
|
9
|
+
require 'logger'
|
10
|
+
$log = Logger.new(STDERR)
|
11
|
+
$log.level = Logger::DEBUG
|
22
12
|
|
23
13
|
#
|
24
14
|
# Path to RAW disk image.
|
data/lib/fs/test/copyTest.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'log4r'
|
2
1
|
require 'ostruct'
|
3
2
|
require 'fs/MiqFS/MiqFS'
|
4
3
|
require 'fs/MiqFsUtil'
|
@@ -9,20 +8,11 @@ SRC_DIR = "../../../.."
|
|
9
8
|
DST_DIR = "copy_dst"
|
10
9
|
MK_FILE = "mkfs"
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
$
|
16
|
-
$
|
17
|
-
class ConsoleFormatter < Log4r::Formatter
|
18
|
-
def format(event)
|
19
|
-
t = Time.now
|
20
|
-
"#{t.hour}:#{t.min}:#{t.sec}: " + (event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
$log = Log4r::Logger.new 'toplog'
|
24
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
25
|
-
$log.add 'err_console'
|
11
|
+
require 'logger'
|
12
|
+
STDOUT.sync = true
|
13
|
+
STDERR.sync = true
|
14
|
+
$log = Logger.new(STDERR)
|
15
|
+
$log.level = Logger::DEBUG
|
26
16
|
|
27
17
|
#
|
28
18
|
# First, copy files from the local filesystem to another directory in the local filesystem.
|
data/lib/fs/test/fsTest.rb
CHANGED
@@ -1,21 +1,11 @@
|
|
1
1
|
require 'manageiq-gems-pending'
|
2
|
-
require 'log4r'
|
3
2
|
require 'ostruct'
|
4
3
|
require 'disk/MiqDisk'
|
5
4
|
require 'fs/MiqFS/MiqFS'
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
class ConsoleFormatter < Log4r::Formatter
|
11
|
-
def format(event)
|
12
|
-
(event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
$log = Log4r::Logger.new 'toplog'
|
16
|
-
$log.level = Log4r::DEBUG
|
17
|
-
Log4r::StderrOutputter.new('err_console', :formatter => ConsoleFormatter)
|
18
|
-
$log.add 'err_console'
|
6
|
+
require 'logger'
|
7
|
+
$log = Logger.new(STDERR)
|
8
|
+
$log.level = Logger::DEBUG
|
19
9
|
|
20
10
|
#
|
21
11
|
# Path to RAW disk image.
|
data/lib/fs/test/updateTest.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'log4r'
|
2
1
|
require 'ostruct'
|
3
2
|
|
4
3
|
require 'fs/MiqFS/MiqFS'
|
@@ -12,20 +11,11 @@ REF_DIR = "copy_dst_ref"
|
|
12
11
|
MK_FILE = "mkfs"
|
13
12
|
MK_FILE_NC = "mkfs_nc"
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
$
|
19
|
-
$
|
20
|
-
class ConsoleFormatter < Log4r::Formatter
|
21
|
-
def format(event)
|
22
|
-
t = Time.now
|
23
|
-
"#{t.hour}:#{t.min}:#{t.sec}: " + (event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
$log = Log4r::Logger.new 'toplog'
|
27
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::DEBUG, :formatter => ConsoleFormatter)
|
28
|
-
$log.add 'err_console'
|
14
|
+
require 'logger'
|
15
|
+
STDOUT.sync = true
|
16
|
+
STDERR.sync = true
|
17
|
+
$log = Logger.new(STDERR)
|
18
|
+
$log.level = Logger::DEBUG
|
29
19
|
|
30
20
|
fromFs = MiqFS.new(LocalFS, nil)
|
31
21
|
toFs = MiqFS.new(LocalFS, nil)
|
@@ -4,12 +4,6 @@ require 'addressable'
|
|
4
4
|
module ManageIQ
|
5
5
|
module Smartstate
|
6
6
|
module Util
|
7
|
-
def self.path_to_uri(file, hostname = nil)
|
8
|
-
file = Addressable::URI.encode(file.tr('\\', '/'))
|
9
|
-
hostname = URI::Generic.build(:host => hostname).host if hostname # ensure IPv6 hostnames
|
10
|
-
"file://#{hostname}/#{file}"
|
11
|
-
end
|
12
|
-
|
13
7
|
def self.uri_to_local_path(uri_path)
|
14
8
|
# Detect and return UNC paths
|
15
9
|
return URI.decode(uri_path) if uri_path[0, 2] == '//'
|
@@ -1,21 +1,13 @@
|
|
1
1
|
require 'metadata/MIQExtract/MIQExtract'
|
2
|
-
require 'log4r'
|
3
2
|
require 'MiqVm/MiqVm'
|
4
3
|
|
5
4
|
# vmDir = "v:"
|
6
5
|
vmDir = File.join(ENV.fetch("HOME", '.'), 'VMs')
|
7
6
|
puts "vmDir = #{vmDir}"
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
toplog = Log4r::Logger.new 'toplog'
|
16
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::ERROR, :formatter => ConsoleFormatter)
|
17
|
-
toplog.add 'err_console'
|
18
|
-
$log = toplog if $log.nil?
|
8
|
+
require 'logger'
|
9
|
+
$log = Logger.new(STDERR)
|
10
|
+
$log.level = Logger::ERROR
|
19
11
|
|
20
12
|
#
|
21
13
|
# *** Test start
|
@@ -1,9 +1,7 @@
|
|
1
|
-
require 'util/miq-logger'
|
2
1
|
require 'tempfile'
|
3
|
-
include Log4r
|
4
2
|
|
5
|
-
|
6
|
-
$log
|
3
|
+
require 'logger'
|
4
|
+
$log = Logger.new(File.expand_path("../../../../log/#{File.basename(__FILE__, ".*")}.log", __dir__))
|
7
5
|
|
8
6
|
require 'metadata/MIQExtract/MIQExtract'
|
9
7
|
require 'util/miq-process'
|
@@ -39,7 +37,7 @@ begin
|
|
39
37
|
|
40
38
|
$log.warn "Fleece for [#{c}] completed [#{Time.now - stf}]"
|
41
39
|
|
42
|
-
$log.
|
40
|
+
$log.info "[#{c}] extract return xml of type [#{xml.class}]" if xml
|
43
41
|
File.open(Tempfile.new("extract_#{c}.xml"), "w") { |f| xml.write(f, 2) } if xml
|
44
42
|
end
|
45
43
|
$log.info "******************** Memory : [#{MiqProcess.processInfo.inspect}] ********************"
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# Only run if we are calling this script directly
|
2
|
-
require 'util/miq-logger'
|
3
2
|
require 'metadata/VmConfig/VmConfig'
|
4
3
|
require 'metadata/MIQExtract/MIQExtract'
|
5
|
-
|
6
|
-
$log
|
4
|
+
|
5
|
+
$log = Logger.new("#{File.basename(__FILE__, ".*")}.log")
|
6
|
+
$log.level = Logger::DEBUG
|
7
7
|
|
8
8
|
vmNames = []
|
9
9
|
# vmNames << "//miq-websvr1/scratch2/vmimages/VMware/DHCP Server/Windows Server 2003 Standard Edition.vmx"
|
@@ -249,22 +249,14 @@ module MiqLinux
|
|
249
249
|
end # module MiqLinux
|
250
250
|
|
251
251
|
if __FILE__ == $0
|
252
|
-
require 'log4r'
|
253
252
|
require 'MiqVm/MiqVm'
|
254
253
|
|
255
254
|
vmDir = File.join(ENV.fetch("HOME", '.'), 'VMs')
|
256
255
|
puts "vmDir = #{vmDir}"
|
257
256
|
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
end
|
262
|
-
end
|
263
|
-
|
264
|
-
toplog = Log4r::Logger.new 'toplog'
|
265
|
-
Log4r::StderrOutputter.new('err_console', :level => Log4r::ERROR, :formatter => ConsoleFormatter)
|
266
|
-
toplog.add 'err_console'
|
267
|
-
$log = toplog if $log.nil?
|
257
|
+
require 'logger'
|
258
|
+
$log = Logger.new(STDERR)
|
259
|
+
$log.level = Logger::ERROR
|
268
260
|
|
269
261
|
#
|
270
262
|
# *** Test start
|
@@ -233,10 +233,9 @@ end
|
|
233
233
|
if __FILE__ == $0
|
234
234
|
# if 1
|
235
235
|
require 'MiqVm/MiqVm'
|
236
|
-
require 'util/miq-logger'
|
237
236
|
|
238
|
-
|
239
|
-
$log
|
237
|
+
require 'logger'
|
238
|
+
$log = Logger.new("#{File.basename(__FILE__, ".*")}.log")
|
240
239
|
|
241
240
|
startTime = Time.now
|
242
241
|
|
data/log/.gitkeep
ADDED
File without changes
|
data/manageiq-smartstate.gemspec
CHANGED
@@ -20,7 +20,6 @@ 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 "addressable", "~> 2.4"
|
24
23
|
spec.add_dependency "azure-armrest"
|
25
24
|
spec.add_dependency "binary_struct", "~> 2.1"
|
26
25
|
spec.add_dependency "iniparse"
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: manageiq-smartstate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
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-
|
11
|
+
date: 2017-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: addressable
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.4'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2.4'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: azure-armrest
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -576,6 +562,7 @@ files:
|
|
576
562
|
- lib/metadata/util/win32/remote-registry.rb
|
577
563
|
- lib/metadata/util/win32/system_path_win.rb
|
578
564
|
- lib/metadata/util/win32/versioninfo.rb
|
565
|
+
- log/.gitkeep
|
579
566
|
- manageiq-smartstate.gemspec
|
580
567
|
homepage: https://github.com/ManageIQ/manageiq-smartstate
|
581
568
|
licenses:
|