From 4c84f185057ee813a891c4d8efbb19b2ca52b93b Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Tue, 24 Sep 2024 16:41:19 -0400 Subject: [PATCH 1/2] Avoid Fixnum --- .../engine/miq_ae_engine/miq_ae_object.rb | 4 ++-- spec/miq_ae_object_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_object.rb b/lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_object.rb index 31cc4c42..34e87c5e 100644 --- a/lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_object.rb +++ b/lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_object.rb @@ -190,7 +190,7 @@ def attribute_value_to_xml(value, xml) case value.class.to_s when 'MiqAePassword' then xml.Password(OPAQUE_PASSWORD) when 'String' then xml.String(value) - when 'Fixnum' then xml.Fixnum(value) + when 'Fixnum', 'Integer' then xml.Integer(value) when 'Symbol' then xml.Symbol(value.to_s) when 'TrueClass', 'FalseClass' then xml.Boolean(value.to_s) when /MiqAeMethodService::(.*)/ then xml.tag!($1.gsub(/::/, '-'), :object_id => value.object_id, :id => value.id) @@ -490,7 +490,7 @@ def self.convert_value_based_on_datatype(value, datatype) return false if datatype == 'FalseClass' return Time.parse(value).getlocal if 'time'.casecmp?(datatype) return value.to_sym if 'symbol'.casecmp?(datatype) - return value.to_i if 'integer'.casecmp?(datatype) || datatype == 'Fixnum' + return value.to_i if 'integer'.casecmp?(datatype) || 'fixnum'.casecmp?(datatype) return value.to_f if 'float'.casecmp?(datatype) return value.gsub(/[\[\]]/, '').strip.split(/\s*,\s*/) if datatype == 'array' && value.class == String return decrypt_password(value) if datatype == 'password' diff --git a/spec/miq_ae_object_spec.rb b/spec/miq_ae_object_spec.rb index 2f5174e7..7a7cb490 100644 --- a/spec/miq_ae_object_spec.rb +++ b/spec/miq_ae_object_spec.rb @@ -329,7 +329,7 @@ def value_match(value, xml_value) context "integer" do it "returns value to_i" do - %w[Integer integer Fixnum].each { |type| expect(described_class.convert_value_based_on_datatype("45", type)).to eq(45) } + %w[Integer integer].each { |type| expect(described_class.convert_value_based_on_datatype("45", type)).to eq(45) } end end From dccd5ad45a47a9eb28b5bbb7dd895e7b78cfeebb Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Fri, 27 Sep 2024 11:38:31 -0400 Subject: [PATCH 2/2] Require drb ``` warning: drb.rb was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.4.0. You can add drb to your Gemfile or gemspec to silence this warning. ``` --- manageiq-automation_engine.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/manageiq-automation_engine.gemspec b/manageiq-automation_engine.gemspec index 50ad8392..e1a2925e 100644 --- a/manageiq-automation_engine.gemspec +++ b/manageiq-automation_engine.gemspec @@ -19,6 +19,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_dependency "rubyzip", "~>2.0.0" + spec.add_dependency "drb" spec.add_development_dependency "manageiq-style" spec.add_development_dependency "simplecov", ">= 0.21.2"