Skip to content

Commit

Permalink
Set up dynamic return data
Browse files Browse the repository at this point in the history
  • Loading branch information
thatch45 committed Apr 14, 2011
1 parent 251ab7a commit 23c9b67
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions salt/cli/__init__.py
Expand Up @@ -70,6 +70,13 @@ def __parse(self):
action='store_true',
help='Instead of using shell globs use the return code'\
+ ' of a function.')
parser.add_option('--return',
default='',
dest='return_',
help='Set an alternative return method. By default salt will'\
+ ' send the return data from the command back to the'\
+ ' master, but the return data can be redirected into'\
+ ' any number of systems, databases or applications.')
parser.add_option('-Q',
'--query',
dest='query',
Expand Down Expand Up @@ -107,6 +114,7 @@ def __parse(self):
opts['list'] = options.list_
opts['facter'] = options.facter
opts['exsel'] = options.exsel
opts['return'] = options.return_
opts['conf_file'] = options.conf_file
opts['raw_out'] = options.raw_out
if JSON:
Expand Down Expand Up @@ -164,7 +172,11 @@ def run(self):
args.append('facter')
elif self.opts['exsel']:
args.append('exsel')
else:
args.append('glob')

if self.opts['return']:
args.append(self.opts['return'])
ret = local.cmd(*args)

# Handle special case commands
Expand Down

0 comments on commit 23c9b67

Please sign in to comment.