run: use predefined name for wsman script

"file tempfile" is not available in tcl versions below 8.6, which are
still wide spread, for example, in Ubuntu 12.04.5 LTS.

Fixes #1328.
This commit is contained in:
Christian Helmuth 2014-12-10 21:06:12 +01:00
parent 22db466194
commit 6344ab94b2
1 changed files with 3 additions and 5 deletions

View File

@ -686,16 +686,16 @@ proc amt_reset_soap_eoi { } {
# Reset via Intel AMT wsman protocol
#
proc amt_reset_wsman { } {
file tempfile xml_request ".xml"
set xml_request "amt-reset-wsman.xml"
set fh [open $xml_request "WRONLY"]
set fh [open $xml_request "WRONLY CREAT TRUNC"]
puts $fh {
<!-- poweron - 2, poweroff - 8, reset - 5 -->
<p:RequestPowerStateChange_INPUT xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_PowerManagementService">
<p:PowerState>5</p:PowerState>
<p:ManagedElement xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
<wsa:ReferenceParameters>
<wsman:ResourceURI>http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem</wsman:ResourceURI>
@ -711,8 +711,6 @@ proc amt_reset_wsman { } {
close $fh
exec wsman invoke -a RequestPowerStateChange -J $xml_request "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_PowerManagementService?SystemCreationClassName=\"CIM_ComputerSystem\",SystemName=\"Intel(r) AMT\",CreationClassName=\"CIM_PowerManagementService\",Name=\"Intel(r) AMT Power Management Service\"" --port 16992 -h $::env(AMT_TEST_MACHINE_IP) --username admin -p $::env(AMT_TEST_MACHINE_PWD) -V -v
file delete $xml_request
}