Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed domainIDExists function. moved logic inline #64

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions pkg/providers/baremetal/mnnvl.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ func getNodeList(cis []topology.ComputeInstances) []string {
return nodes
}

// Check if domainID exists in the map
func domainIDExists(id string, domainMap map[string]domain) bool {
if _, exists := domainMap[id]; exists {
return true
}

return false
}

func populatePartitions(stdout *bytes.Buffer) (map[string][]string, error) {
partitionNodeMap := make(map[string][]string)
// scan each line containing slurm partition and the nodes in it
Expand Down Expand Up @@ -223,7 +214,7 @@ func populateDomains(stdout *bytes.Buffer) (map[string]domain, error) {
}
clusterUUID = strings.TrimSpace(arr[2])
domainName = clusterUUID + cliqueId
if !domainIDExists(domainName, domainMap) {
if _, exists := domainMap[domainName]; !exists {
domainMap[domainName] = domain{
nodeMap: make(map[string]bool),
}
Expand Down