Skip to content

Commit f05abaf

Browse files
committed
Fix warnings raised by URI 1.0.1
Correct error message validation to be less brittle to underlying changes in URI's message format. Related to: https://www.github.com/ruby/uri/issues/125 ManageIQ/manageiq#23260
1 parent 7df03e1 commit f05abaf

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_object.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class MiqAeObject
2020
BASE_CLASS = 'object'.freeze
2121
BASE_OBJECT = [BASE_NAMESPACE, BASE_CLASS].join(PATH_SEPARATOR)
2222
RE_METHOD_CALL = /^[\s]*([\.\/\w]+)[\s]*(?:\((.*)\))?[\s]*$/.freeze
23-
RE_URI_ESCAPE = Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")
23+
RE_URI_ESCAPE = Regexp.new("[^#{URI::RFC2396_PARSER::PATTERN::UNRESERVED}]")
2424
RE_SUBST = /\$\{([^}]+)\}/.freeze
2525
RE_COLLECT_ARRAY = /^[\s]*(?:([\.\/\w]+)[\s]*=[\s]*)?\[(.*)\](?:\.([^.]+))?/.freeze
2626
RE_COLLECT_HASH = /^[\s]*(?:([\.\/\w]+)[\s]*=[\s]*)?\{(.*)\}(?:\.([^.]*))*/.freeze

spec/miq_ae_engine_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,8 +859,7 @@ def before_ae_starts(_options)
859859
expect(test_class_name).to receive(:constantize).and_return(test_class)
860860
expect(test_class).to receive(:find_by!).with(any_args).and_return(test_class_instance)
861861
allow(MiqAeEngine).to receive(:create_automation_attribute_key)
862-
expect($log).to receive(:error)
863-
.with("Error delivering {\"User::user\"=>#{user.id}, nil=>nil} for object \[TestClass.\] with state \[\] to Automate: bad URI(is not URI?): \"_ wrong_uri _\"")
862+
expect($log).to receive(:error).with(/Error delivering.+_ wrong_uri _/)
864863
MiqAeEngine.deliver(options)
865864
end
866865

0 commit comments

Comments
 (0)