Skip to content

Support ShellId returned as WS-Man selector - #193

Open
louispool wants to merge 1 commit into
masterzen:masterfrom
louispool:fix-shellid-selector
Open

louispool wants to merge 1 commit into
masterzen:masterfrom
louispool:fix-shellid-selector

Conversation

@louispool

Copy link
Copy Markdown

Some WinRM responses, including those returned by Windows 7 SP1, do not
include rsp:ShellId in the shell creation response. The ShellId is instead
available only in the WS-Man SelectorSet:

<w:SelectorSet>
    <w:Selector Name="ShellId">...</w:Selector>
</w:SelectorSet>

ParseOpenShellResponse currently only searches for //rsp:ShellId, causing
the parsed ShellId to be empty and subsequent WinRM commands to fail.

This change allows either representation:

//rsp:ShellId | //w:Selector[@Name='ShellId']

A regression test was added for a response containing only the selector form.

Tested with:

  • Windows 7 Professional SP1 x64
  • Packer 1.16.0
  • packer-plugin-hyperv 1.1.5

The new regression test fails with the original XPath and passes with this
change. The full test suite also passes with the fix.

Some WinRM responses, including Windows 7, omit rsp:ShellId and expose the ShellId only through the WS-Man SelectorSet. Parse either representation and add a regression test for the selector-only response.
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.

1 participant