diff --git a/salt/utils/parsers.py b/salt/utils/parsers.py index 40e5d7648e..da7043d249 100644 --- a/salt/utils/parsers.py +++ b/salt/utils/parsers.py @@ -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: