vmware_web_service 3.1.0 → 3.2.0

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: 6f5cfe645f59b74bbc745d9b8ca87f3f812ef66825ed97d1ae9e9ff90581f78b
4
- data.tar.gz: 4159afd750db2f67f086ee758e92f30b9af934003471f6d0e7f721e352e7c1b1
3
+ metadata.gz: d6699c3daae381d3beeb4cfe36d566310ae60a79af7b3aa356c80d526c7479dd
4
+ data.tar.gz: a4bed96d8b73da48abbfe36b7eb1cfa17c9be33dbc3ea6a1a53b519923e34730
5
5
  SHA512:
6
- metadata.gz: 6e6d105b56f251292a513a69f077fe65636fe54d46df9d92739c008a1d8dbfb4a793edb546bc55f67a8f7fcb2dd53f23aa90cc8234bb5c717d9a569fece53bc4
7
- data.tar.gz: fbac5ac0d635a9233fe35195247fdca265e506c4da997f6aa072daad516c160ef9a040b87ab478e6b425b6a0728b7d7674468907abac9df2fb384a748ae81cd4
6
+ metadata.gz: ca0c9b8e60ce1843dc350bad9a952d61ae27954ce1e3f7523d07795a07be929c7c80fd043d48822b3dd8fd9031a371ec9b0733c664046371286175ba1f3e9193
7
+ data.tar.gz: 06fcd323fc89cfc7ed4acdc4f0d5df4752af5a6365adab214ff43766a51558f267ec34823de28bebe20b81b29c3602ee707560870a64ed15d040aebd186f8548
@@ -317,6 +317,6 @@ class MiqVimDataStore
317
317
  end
318
318
 
319
319
  def encode_path_url(path)
320
- URI.encode(path, /[^#{URI::PATTERN::UNRESERVED}]/)
320
+ URI::DEFAULT_PARSER.escape(path, /[^#{URI::PATTERN::UNRESERVED}]/o)
321
321
  end
322
322
  end # module MiqVimDataStore
@@ -100,7 +100,7 @@ class VixDiskLib
100
100
 
101
101
  my_env["LD_LIBRARY_PATH"] = (my_env["LD_LIBRARY_PATH"].to_s.split(':') << VIXDISKLIB_PATH).compact.join(":")
102
102
  raise VixDiskLibError, "VixDiskLib.connect() failed: No logger defined" unless logger
103
- my_env["LOG_FILE"] = logger.logdev.filename.to_s if logger.logdev.kind_of?(Logger::LogDevice)
103
+ my_env["LOG_FILE"] = logger.logdev.filename.to_s if logger.try(:logdev).kind_of?(Logger::LogDevice)
104
104
 
105
105
  my_env
106
106
  end
@@ -2,27 +2,27 @@ require 'drb/drb'
2
2
  require 'sync'
3
3
  require 'ffi-vix_disk_lib/api_wrapper'
4
4
  require 'VMwareWebService/VimTypes'
5
- require 'VMwareWebService/logging'
5
+ require 'VMwareWebService/VixDiskLib/VixDiskLib'
6
6
  require 'time'
7
7
 
8
8
  VixDiskLibApi = FFI::VixDiskLib::ApiWrapper
9
9
  class VdlWrapper
10
10
  extend FFI::VixDiskLib::ApiWrapper
11
11
  include DRb::DRbUndumped
12
- include VMwareWebService::Logging
13
12
 
14
13
  @initialized = false
15
14
  @server_disk_count = 0
16
15
  @vddk = nil
16
+ @logger = Logger.new($stdout)
17
17
 
18
18
  def self.server(server)
19
19
  return unless @vddk.nil?
20
20
  @vddk = server
21
21
  end
22
22
 
23
- @info_log = ->(s) { logger.info "VMware(VixDiskLib): #{s}" }
24
- @warn_log = ->(s) { logger.warn "VMware(VixDiskLib): #{s}" }
25
- @error_log = ->(s) { logger.error "VMware(VixDiskLib): #{s}" }
23
+ @info_log = ->(s) { @logger.info "VMware(VixDiskLib): #{s}" }
24
+ @warn_log = ->(s) { @logger.warn "VMware(VixDiskLib): #{s}" }
25
+ @error_log = ->(s) { @logger.error "VMware(VixDiskLib): #{s}" }
26
26
 
27
27
  def self.init
28
28
  return if @initialized
@@ -32,10 +32,10 @@ class VdlWrapper
32
32
  end
33
33
 
34
34
  def self.dumpDisks(server_name)
35
- logger.warn "*** Open VdlDisks for server #{server_name}"
35
+ @logger.warn "*** Open VdlDisks for server #{server_name}"
36
36
  @connection.dumpDisks unless @connection.nil? || @connection.serverName != server_name
37
37
  @vddk.running = true
38
- logger.warn "*** Open VdlDisks end"
38
+ @logger.warn "*** Open VdlDisks end"
39
39
  end
40
40
 
41
41
  def self.inc_server_disk_count
@@ -51,7 +51,7 @@ class VdlWrapper
51
51
  end
52
52
 
53
53
  def self.connect(connect_parms)
54
- logger.info "VdlWrapper.connect: #{connect_parms[:server_name]}"
54
+ @logger.info "VdlWrapper.connect: #{connect_parms[:server_name]}"
55
55
  raise VixDiskLibError, "VixDiskLib is not initialized" unless @initialized
56
56
  raise VixDiskLibError, "Already connected to #{@connection.serverName}" if @connection
57
57
  @connection = VdlConnection.new(connect_parms, @vddk)
@@ -59,7 +59,7 @@ class VdlWrapper
59
59
  end
60
60
 
61
61
  def self.__disconnect__(conn_obj)
62
- logger.info "VdlWrapper.__disconnect__: #{conn_obj.serverName}"
62
+ @logger.info "VdlWrapper.__disconnect__: #{conn_obj.serverName}"
63
63
  raise VixDiskLibError, "VixDiskLib is not initialized" unless @initialized
64
64
  FFI::VixDiskLib::API.disconnect(conn_obj.vdl_connection)
65
65
  @connection = nil
@@ -74,7 +74,7 @@ class VdlWrapper
74
74
  # the DRb service (this process) to segfault during the exit sequence.
75
75
  #
76
76
  # super
77
- logger.info "VixDiskLib has exited cleanly"
77
+ @logger.info "VixDiskLib has exited cleanly"
78
78
  @vddk.running = true
79
79
  @vddk.shutdown = true
80
80
  @initialized = nil
@@ -84,13 +84,15 @@ end # class VixDiskLib
84
84
  class VdlConnection
85
85
  include DRb::DRbUndumped
86
86
 
87
- attr_reader :vdl_connection, :serverName, :vddk
87
+ attr_reader :logger, :vdl_connection, :serverName, :vddk
88
88
 
89
89
  MAX_DISK_WARN = 9
90
90
 
91
91
  def initialize(connect_parms, vddk)
92
92
  @serverName = connect_parms[:server_name]
93
- logger.info "VdlConnection.initialize: #{@serverName}"
93
+ @logger = Logger.new($stdout)
94
+
95
+ @logger.info "VdlConnection.initialize: #{@serverName}"
94
96
  @vdl_connection = VixDiskLibApi.connect(connect_parms)
95
97
  @disks = []
96
98
  @disk_lock = Sync.new
@@ -171,13 +173,13 @@ end # class VdlConnection
171
173
 
172
174
  class VdlDisk
173
175
  include DRb::DRbUndumped
174
- include VMwareWebService::Logging
175
176
 
176
- attr_reader :path, :flags, :handle, :sectorSize, :timeStamp, :info
177
+ attr_reader :logger, :path, :flags, :handle, :sectorSize, :timeStamp, :info
177
178
 
178
179
  MIN_SECTORS_TO_CACHE = 64
179
180
 
180
181
  def initialize(conn_obj, path, flags)
182
+ @logger = Logger.new($stdout)
181
183
  @time_stamp = Time.now
182
184
  logger.debug { "VdlDisk.new <#{object_id}>: opening #{path}" }
183
185
  @connection = conn_obj
@@ -1,3 +1,6 @@
1
+ require "active_support"
2
+ require "active_support/concern"
3
+
1
4
  module VMwareWebService
2
5
  class << self
3
6
  attr_writer :logger
@@ -9,8 +12,16 @@ module VMwareWebService
9
12
  end
10
13
 
11
14
  module Logging
15
+ extend ActiveSupport::Concern
16
+
17
+ class_methods do
18
+ def logger
19
+ VMwareWebService.logger
20
+ end
21
+ end
22
+
12
23
  def logger
13
- VMwareWebService.logger
24
+ self.class.logger
14
25
  end
15
26
  end
16
27
  end
@@ -1,3 +1,3 @@
1
1
  module VMwareWebService
2
- VERSION = '3.1.0'.freeze
2
+ VERSION = '3.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmware_web_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-03 00:00:00.000000000 Z
11
+ date: 2023-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -163,7 +163,7 @@ dependencies:
163
163
  - !ruby/object:Gem::Version
164
164
  version: 0.21.2
165
165
  description: A ruby interface to Vmware Web Services SDK
166
- email:
166
+ email:
167
167
  executables: []
168
168
  extensions: []
169
169
  extra_rdoc_files: []
@@ -4412,7 +4412,7 @@ homepage: https://github.com/ManageIQ/vmware_web_service
4412
4412
  licenses:
4413
4413
  - Apache-2.0
4414
4414
  metadata: {}
4415
- post_install_message:
4415
+ post_install_message:
4416
4416
  rdoc_options: []
4417
4417
  require_paths:
4418
4418
  - lib
@@ -4420,15 +4420,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
4420
4420
  requirements:
4421
4421
  - - ">="
4422
4422
  - !ruby/object:Gem::Version
4423
- version: 2.5.0
4423
+ version: 2.6.0
4424
4424
  required_rubygems_version: !ruby/object:Gem::Requirement
4425
4425
  requirements:
4426
4426
  - - ">="
4427
4427
  - !ruby/object:Gem::Version
4428
4428
  version: '0'
4429
4429
  requirements: []
4430
- rubygems_version: 3.3.5
4431
- signing_key:
4430
+ rubygems_version: 3.3.15
4431
+ signing_key:
4432
4432
  specification_version: 4
4433
4433
  summary: A ruby interface to Vmware Web Services SDK
4434
4434
  test_files: []