Merge pull request #1623 from anderbubble/DelProfile

Fix DelProfile to operate on profiles, not nodes.
This commit is contained in:
Christian Goll
2025-01-13 08:04:55 +01:00
committed by GitHub
2 changed files with 7 additions and 6 deletions

View File

@@ -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

View File

@@ -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
}