From a5929a01854dd53828e10008b68763c3959632ec Mon Sep 17 00:00:00 2001 From: "Krzysztof A. Adamski" Date: Sun, 29 Jun 2008 14:43:20 -0400 Subject: Add support for forcing some long running methods to be called in async mode from command line. --- func/overlord/cmd_modules/call.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'func/overlord') diff --git a/func/overlord/cmd_modules/call.py b/func/overlord/cmd_modules/call.py index 18af3a6..648bcab 100644 --- a/func/overlord/cmd_modules/call.py +++ b/func/overlord/cmd_modules/call.py @@ -17,13 +17,19 @@ import optparse import pprint import xmlrpclib import time +import sys from func.overlord import client from func.overlord import base_command +from func.config import read_config, BaseConfig, ListOption import func.jobthing as jobthing DEFAULT_FORKS = 1 +config_file = '/etc/func/async_methods.conf' + +class CallConfig(BaseConfig): + force_async = ListOption('') class Call(base_command.BaseCommand): name = "call" @@ -126,6 +132,9 @@ class Call(base_command.BaseCommand): # or some sort of shared datastruct? # self.getOverlord() + call_config = read_config(config_file, CallConfig) + if self.method and (self.module+"."+self.method in call_config.force_async): + self.options.async=True self.interactive = False self.async = self.options.async -- cgit From fa085e9a10aabf66cc784541f3ed8297afaf6436 Mon Sep 17 00:00:00 2001 From: "Krzysztof A. Adamski" Date: Sun, 29 Jun 2008 14:48:11 -0400 Subject: Remove unneded print statement. --- func/overlord/cmd_modules/ping.py | 1 - 1 file changed, 1 deletion(-) (limited to 'func/overlord') diff --git a/func/overlord/cmd_modules/ping.py b/func/overlord/cmd_modules/ping.py index 4e45af8..8c77ada 100644 --- a/func/overlord/cmd_modules/ping.py +++ b/func/overlord/cmd_modules/ping.py @@ -60,7 +60,6 @@ class Ping(base_command.BaseCommand): noglobs=True) results = overlord_obj.run("test", "ping", []) - print "results", results, type(results) if results == 1: print "[ ok ... ] %s" % server else: -- cgit