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

Add partial support for ruby 3 / 3.1 #527

Open
wants to merge 3 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/.bundle/
/.yardoc
/Gemfile.lock
/tags
/_yardoc/
/coverage/
/doc/
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/openstack/compute/requests/delete_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Compute
class Real
def delete_service(uuid, optional_params = nil)
# Encode all params
optional_params = optional_params.each { |k, v| optional_params[k] = URI.encode(v) } if optional_params
optional_params = optional_params.each { |k, v| optional_params[k] = CGI.escape(v) } if optional_params

request(
:expects => [202, 204],
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/openstack/compute/requests/disable_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def disable_service(host, binary, optional_params = nil)
data = {"host" => host, "binary" => binary}

# Encode all params
optional_params = optional_params.each { |k, v| optional_params[k] = URI.encode(v) } if optional_params
optional_params = optional_params.each { |k, v| optional_params[k] = CGI.escape(v) } if optional_params

request(
:body => Fog::JSON.encode(data),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def disable_service_log_reason(host, binary, disabled_reason, optional_params =
data = {"host" => host, "binary" => binary, "disabled_reason" => disabled_reason}

# Encode all params
optional_params = optional_params.each { |k, v| optional_params[k] = URI.encode(v) } if optional_params
optional_params = optional_params.each { |k, v| optional_params[k] = CGI.escape(v) } if optional_params

request(
:body => Fog::JSON.encode(data),
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/openstack/compute/requests/enable_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def enable_service(host, binary, optional_params = nil)
data = {"host" => host, "binary" => binary}

# Encode all params
optional_params = optional_params.each { |k, v| optional_params[k] = URI.encode(v) } if optional_params
optional_params = optional_params.each { |k, v| optional_params[k] = CGI.escape(v) } if optional_params

request(
:body => Fog::JSON.encode(data),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Real
def delete_multiple_objects(container, object_names, options = {})
body = object_names.map do |name|
object_name = container ? "#{container}/#{name}" : name
URI.encode(object_name)
CGI.escape(object_name)
end.join("\n")

response = request({
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/openstack/workflow/v2/requests/delete_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def delete_action(name)
request(
:expects => 204,
:method => "DELETE",
:path => "actions/#{URI.encode(name)}"
:path => "actions/#{CGI.escape(name)}"
)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def delete_cron_trigger(name)
request(
:expects => 204,
:method => "DELETE",
:path => "cron_triggers/#{URI.encode(name)}"
:path => "cron_triggers/#{CGI.escape(name)}"
)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def delete_environment(name)
request(
:expects => 204,
:method => "DELETE",
:path => "environments/#{URI.encode(name)}"
:path => "environments/#{CGI.escape(name)}"
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/openstack/workflow/v2/requests/delete_workbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def delete_workbook(name)
request(
:expects => 204,
:method => "DELETE",
:path => "workbooks/#{URI.encode(name)}"
:path => "workbooks/#{CGI.escape(name)}"
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/openstack/workflow/v2/requests/get_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def get_action(name)
request(
:expects => 200,
:method => "GET",
:path => "actions/#{URI.encode(name)}"
:path => "actions/#{CGI.escape(name)}"
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/openstack/workflow/v2/requests/get_cron_trigger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def get_cron_trigger(name)
request(
:expects => 200,
:method => "GET",
:path => "cron_triggers/#{URI.encode(name)}"
:path => "cron_triggers/#{CGI.escape(name)}"
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/openstack/workflow/v2/requests/get_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def get_environment(name)
request(
:expects => 200,
:method => "GET",
:path => "environments/#{URI.encode(name)}"
:path => "environments/#{CGI.escape(name)}"
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/openstack/workflow/v2/requests/get_workbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def get_workbook(name)
request(
:expects => 200,
:method => "GET",
:path => "workbooks/#{URI.encode(name)}"
:path => "workbooks/#{CGI.escape(name)}"
)
end
end
Expand Down