-
Notifications
You must be signed in to change notification settings - Fork 897
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
Modify the enable ConversionHost::Configurations#enable method to handle arguments more robustly #18336
Conversation
Checked commits https://github.com/djberg96/manageiq/compare/2abf1551ab021b56d5b3d2686573886400b270cd~...0f91297d59449eb8b3232364e5077e890082ae91 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
It looks to me like the tests have passed on Travis, but github is still showing them as pending for some reason. |
@jameswnl Look alright? |
@jameswnl I think there's some kind of side-effect happening in |
@jameswnl With some help from @jrafanie and others, there's some pass by reference argument mangling happening within In fact, the So, there are two options. One is to leave it the way it is right now. The other is to use |
@djberg96 ok, got it. I am ok with leaving it as-is. |
@miq-bot remove_label hammer/no |
@miq-bot add_label hammer/yes |
Modify the enable ConversionHost::Configurations#enable method to handle arguments more robustly (cherry picked from commit 933ff48) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1702023
Hammer backport details:
|
In the course of working on the REST API interface for the
enable
method, I realized there were two issues. First, we cannot guarantee that the keys to theparams
argument will be symbols or strings. Second, theconstantize
method will fail if the case of the argument isn't set properly, which IMO is an implementation detail that a consumer of the REST API should not have to worry about.For the first case, I felt the best thing to do was to simply symbolize all of the arguments so we know we're always dealing with symbols.
For the second case, I modified the call first
downcase
thenclassify
the resource_type argument so thatconstantize
won't fail. Thus, someone using the REST API can pass "vm", "VM", or "Vm" and it will Just Work.Update: Made some similar changes to the
enable_queue
method as well.https://bugzilla.redhat.com/show_bug.cgi?id=1695792