@@ -46,6 +46,9 @@ type CommandLineQConfConfig struct {
4646
4747// NewCommandLineQConf creates a new instance of CommandLineQConf.
4848func NewCommandLineQConf (config CommandLineQConfConfig ) (* CommandLineQConf , error ) {
49+ if config .Executable == "" {
50+ config .Executable = "qconf"
51+ }
4952 return & CommandLineQConf {config : config }, nil
5053}
5154
@@ -122,7 +125,6 @@ func (c *CommandLineQConf) GetClusterConfiguration() (ClusterConfig, error) {
122125 if err != nil {
123126 return cc , fmt .Errorf ("failed to read host config: %v" , err )
124127 }
125-
126128 cc .HostConfigurations [host ] = hc
127129 }
128130
@@ -1115,7 +1117,9 @@ func (c *CommandLineQConf) DeleteHostGroup(groupName string) error {
11151117 return err
11161118}
11171119
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.
11191123func (c * CommandLineQConf ) ShowHostGroup (groupName string ) (HostGroupConfig , error ) {
11201124 out , err := c .RunCommand ("-shgrp" , groupName )
11211125 if err != nil {
@@ -1139,6 +1143,15 @@ func (c *CommandLineQConf) ShowHostGroup(groupName string) (HostGroupConfig, err
11391143 return cfg , nil
11401144}
11411145
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+
11421155// ShowHostGroups shows all host groups.
11431156func (c * CommandLineQConf ) ShowHostGroups () ([]string , error ) {
11441157 output , err := c .RunCommand ("-shgrpl" )
0 commit comments