summaryrefslogtreecommitdiffstats
path: root/func/overlord/cmd_modules
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2007-10-25 18:12:14 -0400
committerMichael DeHaan <mdehaan@redhat.com>2007-10-25 18:12:14 -0400
commitc90d64659a49179cc06f58ac920542f32125d19b (patch)
treece8b40571e6287e8bc89ce851cf5848b795d5301 /func/overlord/cmd_modules
parent1b4fbf4c013f9e08cef511f8b88b516d11fb275c (diff)
downloadthird_party-func-c90d64659a49179cc06f58ac920542f32125d19b.tar.gz
third_party-func-c90d64659a49179cc06f58ac920542f32125d19b.tar.xz
third_party-func-c90d64659a49179cc06f58ac920542f32125d19b.zip
Slight changes to make it easier to establish seperate client handles to all servers and walk them, rather
than using the Client as a multiplexer object. In most cases things won't care, but since ping is an interactive command that is not intended to ever be parsed, this gives the impression that things are more speedy for that one command. Syntax is still "func '*' ping"
Diffstat (limited to 'func/overlord/cmd_modules')
-rw-r--r--func/overlord/cmd_modules/ping.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/func/overlord/cmd_modules/ping.py b/func/overlord/cmd_modules/ping.py
index d5f57cc..29fa9d0 100644
--- a/func/overlord/cmd_modules/ping.py
+++ b/func/overlord/cmd_modules/ping.py
@@ -54,17 +54,22 @@ class Ping(client.command.Command):
def do(self, args):
self.server_spec = self.parentCommand.server_spec
- client_obj = client.Client(self.server_spec,
- port=self.options.port,
- interactive=False,
- verbose=self.options.verbose,
- config=self.config)
-
- results = client_obj.run("test", "ping", [])
- for (host,result) in results.iteritems():
- if result == 1:
- print "[ ok ... ] %s" % host
+ # because this is mainly an interactive command, expand the server list and make seperate connections.
+ # to make things look more speedy.
+
+ servers = client.expand_servers(self.server_spec, port=self.options.port, noglobs=None,
+ verbose=self.options.verbose, just_fqdns=True)
+
+ for server in servers:
+
+ client_obj = client.Client(server,port=self.options.port,interactive=False,
+ verbose=self.options.verbose,config=self.config, noglobs=True)
+
+ results = client_obj.run("test", "ping", [])
+ if results == 1:
+ print "[ ok ... ] %s" % server
else:
- print "[ FAILED ] %s" % host
+ print "[ FAILED ] %s" % server
+
return 1