summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-07-11 16:19:54 -0400
committerMichael DeHaan <mdehaan@redhat.com>2008-07-11 16:19:54 -0400
commit287bf22c59f714c6925377a3a44f59a8906c2e50 (patch)
treeee2ff98138a17cf6e851a6d2b0ce84005abcb401 /scripts
parent0b8bb3c8dff4b612f85187e9fea8a3f3d1233e4c (diff)
downloadfunc-287bf22c59f714c6925377a3a44f59a8906c2e50.tar.gz
func-287bf22c59f714c6925377a3a44f59a8906c2e50.tar.xz
func-287bf22c59f714c6925377a3a44f59a8906c2e50.zip
Allow func-transmit to call "list_minions"
Diffstat (limited to 'scripts')
-rw-r--r--scripts/func-transmit37
1 files changed, 25 insertions, 12 deletions
diff --git a/scripts/func-transmit b/scripts/func-transmit
index 067fec4..1a0e670 100644
--- a/scripts/func-transmit
+++ b/scripts/func-transmit
@@ -42,21 +42,34 @@ input = sys.stdin.read()
params = yaml.load(input).next()
# scan arguments
+
clients = params.get('clients', "*")
-async = params.get('async', False)
-nforks = params.get('nforks', 1)
-module = params.get('module','unknown')
method = params.get('method','unknown')
-parameters = params.get('parameters', None)
-
-# make the call
-client = fc.Overlord(clients, async=async, nforks=nforks)
-module_handle = getattr(client, module)
-method_handle = getattr(module_handle, method)
-if parameters is not None:
- results = method_handle(parameters)
+
+if method == "list_minions":
+ server_spec = "*"
+ minion_set = fc.Minions(server_spec)
+ servers = minion_set.get_all_hosts()
+ servers.sort()
+ results = servers
+
else:
- results = method_handle()
+ # scan more arguments
+ async = params.get('async', False)
+ nforks = params.get('nforks', 1)
+ module = params.get('module','unknown')
+ parameters = params.get('parameters', None)
+
+ # make the call
+ client = fc.Overlord(clients, async=async, nforks=nforks)
+ module_handle = getattr(client, module)
+ method_handle = getattr(module_handle, method)
+ if parameters is not None:
+ results = method_handle(parameters)
+ else:
+ results = method_handle()
+
+# convert to YAML
output = yaml.dump(results)
# write to stdout