vmware_web_service 2.0.0 → 2.1.1

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
  SHA256:
3
- metadata.gz: df40424f3d517dd28e1068afa27577ae38b41eefb926476c43116df2422fe841
4
- data.tar.gz: b1ba415b69bb546c830354ad42fa39cccdeda19104d23672d82909654ea8938f
3
+ metadata.gz: dec8c1bf5bd2dd9fc8d00e057e146cf7dea54c2cbcfe5c500f71389e333d6de4
4
+ data.tar.gz: 331dbc8f7400e12b2a3a5c1c3dd7b474db1880be659a9e182112b23c8278b817
5
5
  SHA512:
6
- metadata.gz: 6716525e09aef414ae8a4cbe341fbd0a10da794e61bc8455e29f1c7df4a1952949151f15be9aec381fab1d355564e4106626f49f9ad1fcb7efd71e3f66afc96b
7
- data.tar.gz: 7c83374173415c650fc5cdd9629d04e298d2a8367191e564e11c5711b82165e23816b86d6c6e2e8e7eb743f99aeba279c0b941c12bac35faf3ccb962ed5daada
6
+ metadata.gz: 73e001def303f702ad26815843ec3b0fc25cbdfa26fb4c796cdec1e333e4a6fb8c0357cf86ce8ea31e076401b9e1729d41555d1668e296d46a4aea7bd59bdf1b
7
+ data.tar.gz: 5e91e171b1d568f6b1920a29ef69161eeebc9accd1261e3e93b7cab58a126f890266013552f23e98c24c1088646512dd97e91b7b08ee52ff4e959f011e33b192
@@ -20,7 +20,7 @@ class MiqVim < MiqVimInventory
20
20
 
21
21
  attr_reader :updateThread, :monitor_updates
22
22
 
23
- # @param server [String] DNS name or IP address of the vCenter Server
23
+ # @param server [String] DNS name or IP address of the vCenter Server
24
24
  # @param username [String] Username to connect to the vCenter Server
25
25
  # @param password [String] Password to connect to the vCenter Server
26
26
  # @param cacheScope [Symbol] A pre-defined set of properties to cache (default: nil)
@@ -30,10 +30,11 @@ class MiqVim < MiqVimInventory
30
30
  # @param notifyMethod [Method] A optional method to call for each update (default: nil)
31
31
  # @param maxWait [Integer] How many seconds to wait before breaking out of WaitForUpdates (default: 60)
32
32
  # @param maxObjects [Integer] How many objects to return from each WaitForUpdates page (default: 250)
33
- def initialize(server, username, password, cacheScope = nil, monitor_updates = false, preLoad = false, debugUpdates = false, notifyMethod = nil, maxWait = 60, maxObjects = 250)
33
+ def initialize(server, username, password, cacheScope = nil, monitor_updates = nil, preLoad = nil, debugUpdates = false, notifyMethod = nil, maxWait = 60, maxObjects = 250)
34
34
  super(server, username, password, cacheScope)
35
35
 
36
- pbm_initialize(self)
36
+ monitor_updates = self.class.monitor_updates if monitor_updates.nil?
37
+ preLoad = self.class.pre_load if preLoad.nil?
37
38
 
38
39
  @monitor_updates = monitor_updates
39
40
  @updateMonitorReady = false
@@ -46,6 +47,25 @@ class MiqVim < MiqVimInventory
46
47
  start_monitor_updates_thread(preLoad) if @monitor_updates
47
48
  end
48
49
 
50
+ @@monitor_updates = false
51
+ @@pre_load = false
52
+
53
+ def self.monitor_updates
54
+ @@monitor_updates
55
+ end
56
+
57
+ def self.monitor_updates=(val)
58
+ @@monitor_updates = val
59
+ end
60
+
61
+ def self.pre_load
62
+ @@pre_load
63
+ end
64
+
65
+ def self.pre_load=(val)
66
+ @@pre_load = val
67
+ end
68
+
49
69
  def getVimVm(path)
50
70
  $vim_log.info "MiqVimMod.getVimVm: called"
51
71
  miqVimVm = nil
@@ -34,7 +34,7 @@ class MiqVimCustomizationSpecManager
34
34
  specs = info
35
35
  return [] if specs.nil?
36
36
 
37
- specs = Array.wrap(specs.dup)
37
+ specs = Array(specs.dup)
38
38
  specs.each { |s| s['spec'] = getCustomizationSpec(s['name'].to_s).spec }
39
39
  specs
40
40
  end
@@ -366,7 +366,12 @@ class MiqVimInventory < MiqVimClientBase
366
366
  #
367
367
  # Hash snapshot info by create time.
368
368
  #
369
- ssMorHash[ssObj['createTime']] = ssObj
369
+ # VMware API strips trailing '0's from the fractional seconds
370
+ # which causes the string to not match what .iso8601(6) returns
371
+ #
372
+ # Example 12:12:59.123Z instead of 12:12:59.123000Z
373
+ create_time = Time.parse(ssObj['createTime']).iso8601(6)
374
+ ssMorHash[create_time] = ssObj
370
375
 
371
376
  #
372
377
  # Ensure childSnapshotList is always present and always an array,
@@ -909,7 +909,7 @@ class MiqVimVm
909
909
  scsi_controllers.sort_by { |s| s["key"].to_i }.each do |scsi_controller|
910
910
  # Skip if all controller units are populated
911
911
  # Bus has 16 units, controller takes up 1 unit itself
912
- device = Array.wrap(scsi_controller["device"])
912
+ device = Array(scsi_controller["device"])
913
913
  next if device.count >= MAX_SCSI_DEVICES
914
914
 
915
915
  # We've found the lowest scsi controller with an available unit
@@ -96,7 +96,8 @@ class VixDiskLib
96
96
 
97
97
  my_env["LD_LIBRARY_PATH"] = (my_env["LD_LIBRARY_PATH"].to_s.split(':') << VIXDISKLIB_PATH).compact.join(":")
98
98
  raise VixDiskLibError, "VixDiskLib.connect() failed: No $vim_log defined" unless $vim_log
99
- my_env["LOG_FILE"] = $vim_log.logdev.filename.to_s
99
+ my_env["LOG_FILE"] = $vim_log.logdev.filename.to_s if $vim_log.logdev.kind_of?(Logger::LogDevice)
100
+
100
101
  my_env
101
102
  end
102
103
 
@@ -109,9 +110,12 @@ class VixDiskLib
109
110
  proc_reader, @proc_writer = IO.pipe
110
111
 
111
112
  server_cmd = "ruby #{SERVER_PATH}/VixDiskLibServer.rb"
113
+ log_target = my_env["LOG_FILE"] ? [my_env["LOG_FILE"], "a"] : $stdout
114
+
112
115
  $vim_log.info "VixDiskLib.start_service: running command = #{server_cmd}"
116
+
113
117
  pid = Kernel.spawn(my_env, server_cmd,
114
- [:out, :err] => [my_env["LOG_FILE"], "a"],
118
+ [:out, :err] => log_target,
115
119
  :unsetenv_others => true,
116
120
  3 => uri_writer,
117
121
  4 => proc_reader)
@@ -11,9 +11,7 @@ require 'VMwareWebService/VixDiskLib/vdl_wrapper'
11
11
  class VixDiskLibError < RuntimeError
12
12
  end
13
13
 
14
- LOG_FILE = ENV["LOG_FILE"]
15
-
16
- $vim_log = Logger.new LOG_FILE
14
+ $vim_log = Logger.new $stdout
17
15
 
18
16
  class VDDKFactory
19
17
  include DRb::DRbUndumped
@@ -4,9 +4,7 @@ require 'ffi-vix_disk_lib/api_wrapper'
4
4
  require 'VMwareWebService/VimTypes'
5
5
  require 'time'
6
6
 
7
- LOG_FILE = ENV["LOG_FILE"]
8
-
9
- $vim_log = Logger.new LOG_FILE
7
+ $vim_log = Logger.new $stdout
10
8
 
11
9
  VixDiskLibApi = FFI::VixDiskLib::ApiWrapper
12
10
  class VdlWrapper
@@ -1,3 +1,3 @@
1
1
  module VMwareWebService
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmware_web_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-04 00:00:00.000000000 Z
11
+ date: 2021-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 5.2.4
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 5.2.4.3
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '6.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: 5.2.4
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: 5.2.4.3
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: ffi-vix_disk_lib
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -4460,7 +4460,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
4460
4460
  - !ruby/object:Gem::Version
4461
4461
  version: '0'
4462
4462
  requirements: []
4463
- rubygems_version: 3.1.3
4463
+ rubygems_version: 3.2.5
4464
4464
  signing_key:
4465
4465
  specification_version: 4
4466
4466
  summary: A ruby interface to Vmware Web Services SDK