Skip to content
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] Allow run_powershell_script method to accept file or string #14854

Closed
wants to merge 1 commit into from
Closed

[SCVMM] Allow run_powershell_script method to accept file or string #14854

wants to merge 1 commit into from

Conversation

djberg96
Copy link
Contributor

At the moment the run_powershell_script method in powershell.rb assumes that it's reading from a file. However, for provisioning requests the scripts are inlined as strings (heredocs), causing a Errno::ENAMETOOLONG error when it tries to read it as a file.

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

I've updated the code to make a file check first, and assume that it's a string if it's not found as a file. I've also added some specs.

@djberg96
Copy link
Contributor Author

@jteehan @bronaghs Please review.

@djberg96
Copy link
Contributor Author

@miq-bot add_label fine/yes

@djberg96
Copy link
Contributor Author

@miq-bot add_label euwe/no

@djberg96
Copy link
Contributor Author

@miq-bot add_label darga/no

@miq-bot
Copy link
Member

miq-bot commented Apr 24, 2017

Checked commit https://github.com/djberg96/manageiq/commit/5a50ca672e701babe9c61f33754db1ef360777e8 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 5 offenses detected

spec/models/manageiq/providers/microsoft/infra_manager/powershell_spec.rb

@djberg96
Copy link
Contributor Author

Upon further review I'm going to just modify the refresh code to pass a string.

@djberg96 djberg96 closed this Apr 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants