Adding quotes around escapechar in ipmitool.tmpl

- Fixes: #1802

Signed-off-by: Shane Nehring <snehring@iastate.edu>
This commit is contained in:
Shane Nehring
2025-03-21 12:31:11 -05:00
committed by Jonathon Anderson
parent a0b741b066
commit e152db228c
3 changed files with 3 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Handle missing ipmi fields during bmc commands. #1768 - Handle missing ipmi fields during bmc commands. #1768
- Properly configure a default IPMI template during `wwctl upgrade nodes --add-defaults`. - Properly configure a default IPMI template during `wwctl upgrade nodes --add-defaults`.
- Fixed display of dotted field names. #1825 - Fixed display of dotted field names. #1825
- Add single quote around escapechar in ipmitool template #1830
### Changed ### Changed

View File

@@ -41,7 +41,7 @@ func Test_Ipmitool(t *testing.T) {
Password: "calvin", Password: "calvin",
}, },
}, },
cmdStr: `ipmitool -I lanplus -e ~ -p 687 -H 192.168.1.100 -U "root" -P "calvin" chassis power status`, cmdStr: `ipmitool -I lanplus -e "~" -p 687 -H 192.168.1.100 -U "root" -P "calvin" chassis power status`,
}, },
"nobmc PowerStatus full": { "nobmc PowerStatus full": {
bmc: TemplateStruct{ bmc: TemplateStruct{

View File

@@ -1,6 +1,6 @@
{{ $cmd := "ipmitool" }} {{ $cmd := "ipmitool" }}
{{ if .Interface }}{{ $cmd = cat $cmd "-I" .Interface }}{{ end }} {{ if .Interface }}{{ $cmd = cat $cmd "-I" .Interface }}{{ end }}
{{ if .EscapeChar }}{{ $cmd = cat $cmd "-e" .EscapeChar }}{{ end }} {{ if .EscapeChar }}{{ $cmd = cat $cmd "-e" (printf "\"%s\"" .EscapeChar) }}{{ end }}
{{ if .Port }}{{ $cmd = cat $cmd "-p" .Port }}{{ end }} {{ if .Port }}{{ $cmd = cat $cmd "-p" .Port }}{{ end }}
{{ if .Ipaddr }}{{ $cmd = cat $cmd "-H" .Ipaddr }}{{ end }} {{ if .Ipaddr }}{{ $cmd = cat $cmd "-H" .Ipaddr }}{{ end }}
{{ if .UserName }}{{ $cmd = cat $cmd "-U" (printf "\"%s\"" .UserName) }}{{ end }} {{ if .UserName }}{{ $cmd = cat $cmd "-U" (printf "\"%s\"" .UserName) }}{{ end }}