mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 12:51:40 +02:00
Add info logging to node repo
This commit is contained in:
@@ -24,7 +24,7 @@ type UpdateNodeStatesRequest struct {
|
|||||||
Cluster string `json:"cluster" example:"fritz"`
|
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 {
|
func determineState(states []string) schema.NodeState {
|
||||||
for _, state := range states {
|
for _, state := range states {
|
||||||
switch strings.ToLower(state) {
|
switch strings.ToLower(state) {
|
||||||
|
@@ -177,6 +177,7 @@ func (r *NodeRepository) UpdateNodeState(hostname string, cluster string, nodeSt
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Infof("Added node '%s' to database", hostname)
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
log.Warnf("Error while querying node '%v' from database", id)
|
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)
|
log.Errorf("error while updating node '%s'", hostname)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
log.Infof("Updated node '%s' in database", hostname)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user