Merge pull request #1623 from anderbubble/DelProfile
Fix DelProfile to operate on profiles, not nodes.
This commit is contained in:
@@ -133,6 +133,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Allow iPXE to continue booting without runtime overlay. #806
|
||||
- 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
|
||||
|
||||
## v4.5.8, 2024-10-01
|
||||
|
||||
|
||||
@@ -93,15 +93,15 @@ func (config *NodesYaml) AddProfile(profileId string) (*Profile, error) {
|
||||
}
|
||||
|
||||
/*
|
||||
delete node with the given id
|
||||
delete profile with the given id
|
||||
*/
|
||||
func (config *NodesYaml) DelProfile(nodeID string) error {
|
||||
if _, ok := config.Nodes[nodeID]; !ok {
|
||||
return errors.New("profile does not exist: " + nodeID)
|
||||
func (config *NodesYaml) DelProfile(profileID string) error {
|
||||
if _, ok := config.NodeProfiles[profileID]; !ok {
|
||||
return errors.New("profile does not exist: " + profileID)
|
||||
}
|
||||
|
||||
wwlog.Verbose("deleting profile: %s", nodeID)
|
||||
delete(config.Nodes, nodeID)
|
||||
wwlog.Verbose("deleting profile: %s", profileID)
|
||||
delete(config.NodeProfiles, profileID)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user