-
Notifications
You must be signed in to change notification settings - Fork 133
Fix/handle faults during create shell #181
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
Fix/handle faults during create shell #181
Conversation
|
@masterzen this would solve some long standing issues in packer |
masterzen
left a comment
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.
Sorry for the late review, I was abroad with few network access.
This looks correct and I'm inclined to merge the PR, but would you mind taking a look at my suggestions?
Thanks!
|
Since the ParseOpenShellResponse and ParseExecuteCommandResponse functions are now almost identical, we could also extract the common parts into it's own function so you get something like this: What are your thoughts on that? func parseResponse(response string, expectedAction, idXPath, errorMsg string) (string, error) {
...
}
func ParseOpenShellResponse(response string) (string, error) {
return parseResponse(
response,
"http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse",
"//rsp:ShellId",
"error during shell creation",
)
}
func ParseExecuteCommandResponse(response string) (string, error) {
return parseResponse(
response,
"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/CommandResponse",
"//rsp:CommandId",
"error during command execution",
)
} |
Indeed, even better! |
|
Sure, I'll create a commit for this when I can. Probably tomorrow morning. |
|
are we good to merge this? @Jbekker |
We are! @masterzen, please take a look. |
masterzen
left a comment
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.
LGTM, let's merge
This is to resolve two open issues, #176 and #41
c.exitCode.