diff options
author | Adrian Likins <alikins@redhat.com> | 2008-03-28 14:13:49 -0400 |
---|---|---|
committer | Adrian Likins <alikins@redhat.com> | 2008-03-28 14:13:49 -0400 |
commit | 4054792be014a9b7373a5b909f5052ab271c2307 (patch) | |
tree | 3cd0cbecad706d16d3483b2c071f101c607580e8 /func/overlord/client.py | |
parent | 8bf00319db57ecfed8477f97e673248ff3d9e44a (diff) | |
download | func-4054792be014a9b7373a5b909f5052ab271c2307.tar.gz func-4054792be014a9b7373a5b909f5052ab271c2307.tar.xz func-4054792be014a9b7373a5b909f5052ab271c2307.zip |
Changing func/func/overlord/client.py:Client() to Overlord(). Client() still
works but will dive a deprecation warning.
First pass at this refactor. I think just about everything has been updated, but
some questions remain. Like if client.py needs a name change.
Diffstat (limited to 'func/overlord/client.py')
-rwxr-xr-x | func/overlord/client.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/func/overlord/client.py b/func/overlord/client.py index 26b1cca..299fb5d 100755 --- a/func/overlord/client.py +++ b/func/overlord/client.py @@ -83,7 +83,7 @@ class CommandAutomagic(object): # =================================== # this is a module level def so we can use it and isServer() from -# other modules with a Client class +# other modules with a Overlord class class Minions(object): def __init__(self, spec, port=51234, @@ -153,7 +153,9 @@ def is_minion(minion_string): return minions.is_minion() -class Client(object): + + +class Overlord(object): def __init__(self, server_spec, port=DEFAULT_PORT, interactive=False, verbose=False, noglobs=False, nforks=1, config=None, async=False, init_ssl=True): @@ -225,9 +227,9 @@ class Client(object): So, it enables stuff like this: - Client("*.example.org").yum.install("foo") + Overlord("*.example.org").yum.install("foo") - # WARNING: any missing values in Client's source will yield + # WARNING: any missing values in Overlord's source will yield # strange errors with this engaged. Be aware of that. """ @@ -239,7 +241,7 @@ class Client(object): """ Use this to acquire status from jobs when using run with async client handles """ - return jobthing.job_status(jobid, client_class=Client) + return jobthing.job_status(jobid, client_class=Overlord) # ----------------------------------------------- @@ -250,7 +252,7 @@ class Client(object): returns. The returns may include exception objects. - If Client() was constructed with noglobs=True, the return is instead + If Overlord() was constructed with noglobs=True, the return is instead just a single value, not a hash. """ @@ -352,3 +354,11 @@ class Client(object): if x > max: max = x return max + + +class Client(Overlord): + def __init__(self, *args, **kwargs): + Overlord.__init__(self, *args, **kwargs) + # we can remove this if folks want -akl + print "Client() class is deprecated, please use the Overlord() class." + |