communicators/winrm: detect parse errors in powershell and error
/cc @sneal - Any better way to do this?
This commit is contained in:
parent
57e7633c4d
commit
79873cdb44
|
@ -17,6 +17,7 @@ BUG FIXES:
|
||||||
- commands/push: push lookups are by user-defined name, not push
|
- commands/push: push lookups are by user-defined name, not push
|
||||||
strategy name [GH-4975]
|
strategy name [GH-4975]
|
||||||
- commands/push: validate the configuration
|
- commands/push: validate the configuration
|
||||||
|
- communicators/winrm: detect parse errors in PowerShell and error
|
||||||
- guests/arch: fix network configuration due to poor line breaks. [GH-4964]
|
- guests/arch: fix network configuration due to poor line breaks. [GH-4964]
|
||||||
- guests/solaris: Merge configurations properly so configs can be set
|
- guests/solaris: Merge configurations properly so configs can be set
|
||||||
in default Vagrantfiles. [GH-5092]
|
in default Vagrantfiles. [GH-5092]
|
||||||
|
|
|
@ -93,7 +93,23 @@ module VagrantPlugins
|
||||||
block.call(:stdout, out) if block_given? && out
|
block.call(:stdout, out) if block_given? && out
|
||||||
block.call(:stderr, err) if block_given? && err
|
block.call(:stderr, err) if block_given? && err
|
||||||
end
|
end
|
||||||
|
|
||||||
@logger.debug("Output: #{output.inspect}")
|
@logger.debug("Output: #{output.inspect}")
|
||||||
|
|
||||||
|
# Verify that we didn't get a parser error, and if so we should
|
||||||
|
# set the exit code to 1. Parse errors return exit code 0 so we
|
||||||
|
# need to do this.
|
||||||
|
if output[:exitcode] == 0
|
||||||
|
(output[:data] || []).each do |data|
|
||||||
|
next if !data[:stderr]
|
||||||
|
if data[:stderr].include?("ParserError")
|
||||||
|
@logger.warn("Detected ParserError, setting exit code to 1")
|
||||||
|
output[:exitcode] = 1
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return output
|
return output
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue