-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't call Gem::Version.new() with a nil version #247
Don't call Gem::Version.new() with a nil version #247
Conversation
If the EMS api_version is nil don't call Gem::Version.new() to prevent the exception: ``` ArgumentError: Malformed version number string ``` This behavior changed in gem version 2.7.7 https://travis-ci.org/ManageIQ/manageiq-providers-ovirt/builds/380600591#L1969
Checked commit agrare@3f64cc1 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@@ -14,7 +14,7 @@ def configure_cloud_init | |||
return unless content = customization_template_content | |||
with_provider_destination { |d| d.update_cloud_init!(content) } | |||
|
|||
if Gem::Version.new(source.ext_management_system.api_version) >= Gem::Version.new("3.5.5.0") | |||
if source.ext_management_system.api_version && Gem::Version.new(source.ext_management_system.api_version) >= Gem::Version.new("3.5.5.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be worth assigning source.ext_management_system.api_version
to a variable for readability, up to you though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 good point I'll push a followup to address this
Don't call Gem::Version.new() with a nil version (cherry picked from commit adf168a)
Gaprindashvili backport details:
|
If the EMS api_version is nil don't call Gem::Version.new() to prevent
the exception:
This behavior changed in gem version 2.7.7
https://travis-ci.org/ManageIQ/manageiq-providers-ovirt/builds/380600591#L1969