From c90d64659a49179cc06f58ac920542f32125d19b Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 25 Oct 2007 18:12:14 -0400 Subject: 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" --- func/overlord/cmd_modules/ping.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'func/overlord/cmd_modules') 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 -- cgit