Merge pull request #1626 from mslacken/FailedSetOnBoot
added failing test for set --onboot
This commit is contained in:
@@ -135,6 +135,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Format errors in logs as strings. #1563
|
||||
- Fix display of profiles during node list. #1496
|
||||
- Fix internal DelProfile function to correctly operate on profiles rather than nodes. #1622
|
||||
- Fix parsing of bool command line variables #1627
|
||||
|
||||
## v4.5.8, 2024-10-01
|
||||
|
||||
|
||||
@@ -382,6 +382,30 @@ nodes:
|
||||
ipaddr: 172.16.130.101
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "single node set onboot",
|
||||
args: []string{"--netname", "default", "--onboot=true", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `nodeprofiles:
|
||||
default: {}
|
||||
nodes:
|
||||
n01:
|
||||
network devices:
|
||||
default:
|
||||
ipaddr: 172.16.130.101
|
||||
|
||||
`,
|
||||
outDb: `nodeprofiles:
|
||||
default: {}
|
||||
nodes:
|
||||
n01:
|
||||
network devices:
|
||||
default:
|
||||
ipaddr: 172.16.130.101
|
||||
onboot: "true"
|
||||
`,
|
||||
},
|
||||
|
||||
{
|
||||
name: "single node set fs,part and disk",
|
||||
|
||||
@@ -66,7 +66,7 @@ func ObjectIsEmpty(obj interface{}) bool {
|
||||
}
|
||||
for i := 0; i < varType.NumField(); i++ {
|
||||
if varType.Field(i).Type.Kind() == reflect.String && !varVal.Field(i).IsZero() {
|
||||
val := varVal.Field(i).Interface().(string)
|
||||
val := varVal.Field(i).String()
|
||||
if val != "" {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user