simplified node list command
This commit is contained in:
@@ -108,7 +108,6 @@ node itself, for all values of type Entry.
|
||||
*/
|
||||
type NodeInfo struct {
|
||||
Id Entry
|
||||
Cid Entry
|
||||
Comment Entry
|
||||
ClusterName Entry
|
||||
ContainerName Entry
|
||||
@@ -122,7 +121,6 @@ type NodeInfo struct {
|
||||
Kernel *KernelEntry
|
||||
Ipmi *IpmiEntry
|
||||
Profiles []string
|
||||
GroupProfiles []string
|
||||
NetDevs map[string]*NetDevEntry
|
||||
Tags map[string]*Entry
|
||||
}
|
||||
@@ -140,7 +138,6 @@ type IpmiEntry struct {
|
||||
}
|
||||
|
||||
type KernelEntry struct {
|
||||
Version Entry
|
||||
Override Entry
|
||||
Args Entry
|
||||
}
|
||||
@@ -160,6 +157,9 @@ type NetDevEntry struct {
|
||||
Tags map[string]*Entry
|
||||
}
|
||||
|
||||
// string which is printed if no value is set
|
||||
const NoValue = "--"
|
||||
|
||||
func init() {
|
||||
// Check that nodes.conf is found
|
||||
if !util.IsFile(ConfigFile) {
|
||||
|
||||
@@ -580,3 +580,20 @@ func (baseCmd *CobraCommand) CreateFlags(theStruct interface{}, excludeList []st
|
||||
}
|
||||
return optionsMap
|
||||
}
|
||||
|
||||
/*
|
||||
Helper function which gets the lopt of a given interface
|
||||
*/
|
||||
func GetLoptOf(myStruct interface{}, name string) string {
|
||||
retStr := ""
|
||||
if reflect.TypeOf(myStruct).Kind() != reflect.Struct {
|
||||
return retStr
|
||||
}
|
||||
myType := reflect.TypeOf(myStruct)
|
||||
field, ok := myType.FieldByName(name)
|
||||
if ok {
|
||||
retStr = field.Tag.Get("lopt")
|
||||
}
|
||||
return retStr
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user