summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKrzysztof A. Adamski <krzysztofa@gmail.com>2008-08-07 19:28:33 -0400
committerKrzysztof A. Adamski <krzysztofa@gmail.com>2008-08-07 19:28:33 -0400
commita1ba474f36ba7391accb63f3282138fcd2d480ce (patch)
tree5a2e16fbbac0978c15fdb7a579ed82c1def0cf92 /scripts
parentbb9dbf973f9bbc2024142e0f6e0b625a6d503803 (diff)
downloadfunc-a1ba474f36ba7391accb63f3282138fcd2d480ce.tar.gz
func-a1ba474f36ba7391accb63f3282138fcd2d480ce.tar.xz
func-a1ba474f36ba7391accb63f3282138fcd2d480ce.zip
Use overlod module to list_minions() instead of the hack in func-transmit.
Diffstat (limited to 'scripts')
-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):