diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5d4dc027..a2fb341d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -45,4 +45,4 @@ jobs: - name: Report code coverage if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.1' }} continue-on-error: true - uses: paambaati/codeclimate-action@v8 + uses: paambaati/codeclimate-action@v9 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 0a252617..18ba5c26 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) @@ -486,7 +486,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/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" 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