mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Allow split of list using spaces.
This change checks for comma existence and if its not there splits based on spaces. Should have identical use as previously. It also solves the problem of giving non-comma-delimited-output to salt from other programs.
This commit is contained in:
parent
a52773e940
commit
ecce87a9a7
@ -1036,7 +1036,10 @@ class SaltCMDOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn,
|
||||
self.args[2] = self.args[2]
|
||||
|
||||
if self.options.list:
|
||||
self.config['tgt'] = self.args[0].split(',')
|
||||
if ',' in self.args[0]:
|
||||
self.config['tgt'] = self.args[0].split(',')
|
||||
else:
|
||||
self.config['tgt'] = self.args[0].split()
|
||||
else:
|
||||
self.config['tgt'] = self.args[0]
|
||||
|
||||
@ -1107,7 +1110,10 @@ class SaltCPOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn,
|
||||
self.exit(1)
|
||||
|
||||
if self.options.list:
|
||||
self.config['tgt'] = self.args[0].split(',')
|
||||
if ',' in self.args[0]:
|
||||
self.config['tgt'] = self.args[0].split(',')
|
||||
else:
|
||||
self.config['tgt'] = self.args[0].split()
|
||||
else:
|
||||
self.config['tgt'] = self.args[0]
|
||||
self.config['src'] = self.args[1:-1]
|
||||
@ -1487,7 +1493,10 @@ class SaltSSHOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn,
|
||||
|
||||
def _mixin_after_parsed(self):
|
||||
if self.options.list:
|
||||
self.config['tgt'] = self.args[0].split(',')
|
||||
if ',' in self.args[0]:
|
||||
self.config['tgt'] = self.args[0].split(',')
|
||||
else:
|
||||
self.config['tgt'] = self.args[0].split()
|
||||
else:
|
||||
self.config['tgt'] = self.args[0]
|
||||
if len(self.args) > 0:
|
||||
|
Loading…
Reference in New Issue
Block a user