@@ -46,6 +46,9 @@ type CommandLineQConfConfig struct {
46
46
47
47
// NewCommandLineQConf creates a new instance of CommandLineQConf.
48
48
func NewCommandLineQConf (config CommandLineQConfConfig ) (* CommandLineQConf , error ) {
49
+ if config .Executable == "" {
50
+ config .Executable = "qconf"
51
+ }
49
52
return & CommandLineQConf {config : config }, nil
50
53
}
51
54
@@ -122,7 +125,6 @@ func (c *CommandLineQConf) GetClusterConfiguration() (ClusterConfig, error) {
122
125
if err != nil {
123
126
return cc , fmt .Errorf ("failed to read host config: %v" , err )
124
127
}
125
-
126
128
cc .HostConfigurations [host ] = hc
127
129
}
128
130
@@ -1115,7 +1117,9 @@ func (c *CommandLineQConf) DeleteHostGroup(groupName string) error {
1115
1117
return err
1116
1118
}
1117
1119
1118
- // ShowHostGroup shows the specified host group.
1120
+ // ShowHostGroup shows the host list of a particular host group. The host
1121
+ // list can contain other host groups. Use ShowHowGroupResolved() for
1122
+ // getting a list of all hosts.
1119
1123
func (c * CommandLineQConf ) ShowHostGroup (groupName string ) (HostGroupConfig , error ) {
1120
1124
out , err := c .RunCommand ("-shgrp" , groupName )
1121
1125
if err != nil {
@@ -1139,6 +1143,15 @@ func (c *CommandLineQConf) ShowHostGroup(groupName string) (HostGroupConfig, err
1139
1143
return cfg , nil
1140
1144
}
1141
1145
1146
+ // ShowHostGroupResolved shows all hosts in a host group and all sub-groups.
1147
+ func (c * CommandLineQConf ) ShowHostGroupResolved (groupName string ) ([]string , error ) {
1148
+ out , err := c .RunCommand ("-shgrp_resolved" , groupName )
1149
+ if err != nil {
1150
+ return nil , err
1151
+ }
1152
+ return splitWithoutEmptyLines (out , "\n " ), nil
1153
+ }
1154
+
1142
1155
// ShowHostGroups shows all host groups.
1143
1156
func (c * CommandLineQConf ) ShowHostGroups () ([]string , error ) {
1144
1157
output , err := c .RunCommand ("-shgrpl" )
0 commit comments