RedHatCloudForms / cfme-cloud_services

Red Hat Cloud Services plugin for CloudForms
Apache License 2.0
5 stars 13 forks source link

Fix sync_all_collection and sync_collection #45

Closed agrare closed 5 years ago

agrare commented 5 years ago

Fix two issues with syncing multiple providers.

  1. Targets must be of form [[klass, id]] not [id]

Fix invalid targets being passed to InventorySync.sync, targets must either be an ActiveRecord object or a [klass, id] pair. This was passing just id.

  1. Fix comparison of strings with integers

data["provider_ids"] looks like ["1", "2"] but find_provider_ids looks like [1, 2] so every provider id looks invalid.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1751877

miq-bot commented 5 years ago

Some comments on commits https://github.com/agrare/cfme-cloud_services/compare/891dbdd49d384597cb99aca13275cc97df2de0c4~...fcbd46f5f7f8a64f43408d09694a88d315be87b5

app/controllers/api/red_hat_cloud_service_providers_controller.rb

spec/requests/red_hat_cloud_service_providers_spec.rb

miq-bot commented 5 years ago

Checked commits https://github.com/agrare/cfme-cloud_services/compare/891dbdd49d384597cb99aca13275cc97df2de0c4~...fcbd46f5f7f8a64f43408d09694a88d315be87b5 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 2 files checked, 0 offenses detected Everything looks fine. :trophy: