mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-06-08 00:23:48 +02:00
Add info logging to node repo
This commit is contained in:
parent
9cd4b3c1cc
commit
ca16a80b1f
@ -24,7 +24,7 @@ type UpdateNodeStatesRequest struct {
|
||||
Cluster string `json:"cluster" example:"fritz"`
|
||||
}
|
||||
|
||||
// this routine assumes that only one of them applies per node
|
||||
// this routine assumes that only one of them exists per node
|
||||
func determineState(states []string) schema.NodeState {
|
||||
for _, state := range states {
|
||||
switch strings.ToLower(state) {
|
||||
|
@ -177,6 +177,7 @@ func (r *NodeRepository) UpdateNodeState(hostname string, cluster string, nodeSt
|
||||
return err
|
||||
}
|
||||
|
||||
log.Infof("Added node '%s' to database", hostname)
|
||||
return nil
|
||||
} else {
|
||||
log.Warnf("Error while querying node '%v' from database", id)
|
||||
@ -188,7 +189,7 @@ func (r *NodeRepository) UpdateNodeState(hostname string, cluster string, nodeSt
|
||||
log.Errorf("error while updating node '%s'", hostname)
|
||||
return err
|
||||
}
|
||||
|
||||
log.Infof("Updated node '%s' in database", hostname)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user