Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix warnings raised by URI 1.0.1 #596

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/gems/pending/util/miq_file_storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def self.fetch_interface_class(opts)
return nil unless opts[:uri]

require 'uri'
scheme, _ = URI.split(URI::DEFAULT_PARSER.escape(opts[:uri]))
scheme, _ = URI.split(URI::RFC2396_PARSER.escape(opts[:uri]))
klass = storage_interface_classes[scheme]

raise InvalidSchemeError, scheme if klass.nil?
Expand Down
8 changes: 4 additions & 4 deletions lib/gems/pending/util/mount/miq_generic_mount_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def self.new_with_opts(opts)

def self.uri_scheme_to_class(uri)
require 'uri'
scheme, userinfo, host, port, registry, share, opaque, query, fragment = URI.split(URI::DEFAULT_PARSER.escape(uri))
scheme, userinfo, host, port, registry, share, opaque, query, fragment = URI.split(URI::RFC2396_PARSER.escape(uri))
case scheme
when 'smb'
MiqSmbSession
Expand Down Expand Up @@ -321,8 +321,8 @@ def log_uri_still_configured?(log_uri)
# Only remove the log file if the current depot @settings are based on the same base URI as the log_uri to be removed
return false if log_uri.nil? || @settings[:uri].nil?

scheme, userinfo, host, port, registry, share, opaque, query, fragment = URI.split(URI::DEFAULT_PARSER.escape(@settings[:uri]))
scheme_log, userinfo_log, host_log, port_log, registry_log, share_log, opaque_log, query_log, fragment_log = URI.split(URI::DEFAULT_PARSER.escape(log_uri))
scheme, userinfo, host, port, registry, share, opaque, query, fragment = URI.split(URI::RFC2396_PARSER.escape(@settings[:uri]))
scheme_log, userinfo_log, host_log, port_log, registry_log, share_log, opaque_log, query_log, fragment_log = URI.split(URI::RFC2396_PARSER.escape(log_uri))

return false if scheme != scheme_log
return false if host != host_log
Expand Down Expand Up @@ -451,7 +451,7 @@ def mount_root
def relative_to_mount(uri)
log_header = "MIQ(#{self.class.name}-relative_to_mount)"
logger.info("#{log_header} mount point [#{@mount_path}], uri: [#{uri}]...")
scheme, userinfo, host, port, registry, path, opaque, query, fragment = URI.split(URI::DEFAULT_PARSER.escape(uri))
scheme, userinfo, host, port, registry, path, opaque, query, fragment = URI.split(URI::RFC2396_PARSER.escape(uri))

# Replace any encoded spaces back into spaces since the mount commands accepts quoted spaces
path.gsub!('%20', ' ')
Expand Down
2 changes: 1 addition & 1 deletion lib/gems/pending/util/mount/miq_glusterfs_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(log_settings)

def connect
_scheme, _userinfo, @host, _port, _registry, @mount_path, _opaque, _query, _fragment =
URI.split(URI::DEFAULT_PARSER.escape(@settings[:uri]))
URI.split(URI::RFC2396_PARSER.escape(@settings[:uri]))
super
end

Expand Down
2 changes: 1 addition & 1 deletion lib/gems/pending/util/mount/miq_nfs_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(log_settings)
end

def connect
scheme, userinfo, @host, port, registry, @mount_path, opaque, query, fragment = URI.split(URI::DEFAULT_PARSER.escape(@settings[:uri]))
scheme, userinfo, @host, port, registry, @mount_path, opaque, query, fragment = URI.split(URI::RFC2396_PARSER.escape(@settings[:uri]))
super
end

Expand Down
2 changes: 1 addition & 1 deletion lib/gems/pending/util/mount/miq_smb_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize(log_settings)
end

def connect
scheme, userinfo, @host, port, registry, @mount_root, opaque, query, fragment = URI.split(URI::DEFAULT_PARSER.escape(@settings[:uri]))
scheme, userinfo, @host, port, registry, @mount_root, opaque, query, fragment = URI.split(URI::RFC2396_PARSER.escape(@settings[:uri]))
@mount_path = @mount_root.split("/")[0..1].join("/")
super
end
Expand Down
4 changes: 2 additions & 2 deletions lib/gems/pending/util/object_storage/miq_swift_storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def initialize(settings)
@bucket_name = URI(@settings[:uri]).host

raise "username and password are required values!" if @settings[:username].nil? || @settings[:password].nil?
_scheme, _userinfo, @host, @port, _registry, path, _opaque, query, _fragment = URI.split(URI::DEFAULT_PARSER.escape(@settings[:uri]))
_scheme, _userinfo, @host, @port, _registry, path, _opaque, query, _fragment = URI.split(URI::RFC2396_PARSER.escape(@settings[:uri]))
query_params(query) if query
@swift = nil
@username = @settings[:username]
Expand All @@ -28,7 +28,7 @@ def initialize(settings)
def uri_to_object_path(remote_file)
# Strip off the leading "swift://" and the container name from the URI"
# Also remove the leading delimiter.
object_file_with_bucket = URI.split(URI::DEFAULT_PARSER.escape(remote_file))[5]
object_file_with_bucket = URI.split(URI::RFC2396_PARSER.escape(remote_file))[5]
object_file_with_bucket.split(File::Separator)[2..-1].join(File::Separator)
end

Expand Down
1 change: 1 addition & 0 deletions manageiq-gems-pending.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "rexml", ">= 3.3.6"
s.add_runtime_dependency "sys-proctable", "~> 1.2.5"
s.add_runtime_dependency "sys-uname", "~> 1.2.1"
s.add_runtime_dependency "uri", "~> 1.0.0", ">= 1.0.1"
s.add_runtime_dependency "win32ole", "~> 1.8.8" # this gem was extracted in ruby 3 - required if we use wmi on windows
s.add_runtime_dependency "zeitwerk", "~> 2.6", ">= 2.6.8"

Expand Down
Loading