-
Notifications
You must be signed in to change notification settings - Fork 898
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
[SCVMM] Always assume a string for run_powershell_script #14859
Conversation
@miq-bot add_label fine/yes |
@miq-bot add_label euwe/no |
@miq-bot add_label darga/no |
LGTM, not that anybody asked. :-) |
@jerryk55 Appreciated! |
Verified against 5.8.0.11 and the ERR message is no longer present. This fix is working fine. |
@@ -20,7 +20,8 @@ def ems_inv_to_hashes | |||
log_header = "MIQ(#{self.class.name}.#{__method__}) Collecting data for EMS name: [#{@ems.name}] id: [#{@ems.id}]" | |||
$scvmm_log.info("#{log_header}...") | |||
|
|||
@inventory = ManageIQ::Providers::Microsoft::InfraManager.execute_powershell_json(@connection, INVENTORY_SCRIPT) | |||
@script = IO.read(INVENTORY_SCRIPT) |
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.
Does this have to be an instance var? Looks like it's just used on the next line.
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.
I figured I would do that just in case we needed it elsewhere someday.
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.
@blomquisg ok, changed it. :)
@djberg96 - what caused this to break all of a sudden? |
@bronaghs I think I broke something in the process of cleaning up some things while I was working on the refresh parser revamp. |
Added some basic run_powershell_script specs.
Checked commit https://github.com/djberg96/manageiq/commit/4337c139afbcdf729e6a9f8c1a67c335e1fca658 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 spec/models/manageiq/providers/microsoft/infra_manager/powershell_spec.rb
|
[SCVMM] Always assume a string for run_powershell_script (cherry picked from commit a3cafd8) https://bugzilla.redhat.com/show_bug.cgi?id=1445936
Fine backport details:
|
This fixes an issue where our
run_powershell_script
method was assuming a file argument, but in most cases a string (heredoc) argument was being passed instead.This PR alters the code so that it's always assumes a string instead of a file.
https://bugzilla.redhat.com/show_bug.cgi?id=1444201