ManageIQ / azure-armrest

Ruby interface for Azure using the new REST API
Apache License 2.0
15 stars 36 forks source link

Don't append api-version string if already included #347

Closed djberg96 closed 6 years ago

djberg96 commented 6 years ago

When the build_id_string method was refactored, I accidentally introduced a bug in the TemplateDeploymentService#delete_associated_resources method. That method uses a combination of build_id_string and delete_by_id. The problem is that both methods append an api-version string, resulting in an invalid URL.

This PR modifies the get_by_id and delete_by_id methods so that the api-version string is only appended if it's not already present.

Addresses https://bugzilla.redhat.com/show_bug.cgi?id=1497175

bzwei commented 6 years ago

Looks like we can consolidate the changes into one common method like id_string_to_url

bzwei commented 6 years ago

@djberg96 can you add link https://bugzilla.redhat.com/show_bug.cgi?id=1497175 to the commit comment so that the BZ gets the notification?

djberg96 commented 6 years ago

@bzwei Ok, refactored into a common method.

miq-bot commented 6 years ago

Checked commit https://github.com/djberg96/azure-armrest/commit/a6d8f802a96a113c7e850af7043e20d7c4d33aea with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 1 file checked, 0 offenses detected Everything looks fine. :star: