summaryrefslogtreecommitdiffstats
path: root/scripts/func-transmit
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-08-13 11:55:53 +0300
committermakkalot <makkalot@gmail.com>2008-08-13 11:55:53 +0300
commit14dbbf0b9d7f50d2dffaf2306b21e41d3e7e8cdc (patch)
tree4ed2b10efafbc81850d31c629da337d33369706e /scripts/func-transmit
parent56ba41a1a331ebff0c471d6f85b1c7c11a1ab6d8 (diff)
parent32689058c602362dcab1b1ae564d86ecc04c4b79 (diff)
merge master into the export_methods branch
Diffstat (limited to 'scripts/func-transmit')
-rw-r--r--scripts/func-transmit50
1 files changed, 19 insertions, 31 deletions
diff --git a/scripts/func-transmit b/scripts/func-transmit
index 4fe3cc3..40ccae6 100644
--- a/scripts/func-transmit
+++ b/scripts/func-transmit
@@ -93,38 +93,26 @@ def main(argv):
method = params.get('method','unknown')
async = params.get('async', False)
- if method == "list_minions":
- # clients will default to * if not specified, and specifing is a good
- # way to see who is in what group, etc, so pass it though
-
- if async == True:
- raise NoAsyncForListMinionException("list_minions method can not be run in async")
-
- minion_set = fc.Minions(clients)
- servers = minion_set.get_all_hosts()
- results = servers
-
+ # scan more arguments
+ nforks = params.get('nforks', 1)
+ module = params.get('module', None)
+ parameters = params.get('parameters', None)
+
+ # make the call
+ client = fc.Overlord(clients, async=async, nforks=nforks)
+ if module is None:
+ method_handle = getattr(client, method)
+ else:
+ module_handle = getattr(client, module)
+ method_handle = getattr(module_handle, method)
+
+ if parameters is not None:
+ # listify if we get something thats not a list
+ if not is_a_list(parameters):
+ parameters = [parameters]
+ results = method_handle(*parameters)
else:
- # scan more arguments
- nforks = params.get('nforks', 1)
- module = params.get('module', None)
- parameters = params.get('parameters', None)
-
- # make the call
- client = fc.Overlord(clients, async=async, nforks=nforks)
- if module is None:
- method_handle = getattr(client, method)
- else:
- module_handle = getattr(client, module)
- method_handle = getattr(module_handle, method)
-
- if parameters is not None:
- # listify if we get something thats not a list
- if not is_a_list(parameters):
- parameters = [parameters]
- results = method_handle(*parameters)
- else:
- results = method_handle()
+ results = method_handle()
# convert to selected language (default is JSON)
if (options.json):