mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-25 23:19:06 +01:00
Fix error print in LustreCollector
This commit is contained in:
parent
07af660e50
commit
f1d2828e1d
@ -110,14 +110,16 @@ func (m *LustreCollector) Init(config json.RawMessage) error {
|
|||||||
"inode_permission": {"lustre_inode_permission": 1}}
|
"inode_permission": {"lustre_inode_permission": 1}}
|
||||||
|
|
||||||
// Lustre file system statistics can only be queried by user root
|
// Lustre file system statistics can only be queried by user root
|
||||||
user, err := user.Current()
|
if !m.config.Sudo {
|
||||||
if err != nil {
|
user, err := user.Current()
|
||||||
cclog.ComponentError(m.name, "Failed to get current user:", err.Error())
|
if err != nil {
|
||||||
return err
|
cclog.ComponentError(m.name, "Failed to get current user:", err.Error())
|
||||||
}
|
return err
|
||||||
if user.Uid != "0" {
|
}
|
||||||
cclog.ComponentError(m.name, "Lustre file system statistics can only be queried by user root:", err.Error())
|
if user.Uid != "0" {
|
||||||
return err
|
cclog.ComponentError(m.name, "Lustre file system statistics can only be queried by user root")
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m.matches = make(map[string]map[string]int)
|
m.matches = make(map[string]map[string]int)
|
||||||
|
Loading…
Reference in New Issue
Block a user