summaryrefslogtreecommitdiffstats
path: root/func/overlord/client.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-01-29 16:19:30 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-01-29 16:19:30 -0500
commitb3c5591d70c1c354d14267e804ab64872af97b40 (patch)
treea361f4d0ea060df23ffbccf9961f38bb01a65d23 /func/overlord/client.py
parent1d60f197dab809e9a51c3377587d46370e698c52 (diff)
downloadthird_party-func-b3c5591d70c1c354d14267e804ab64872af97b40.tar.gz
third_party-func-b3c5591d70c1c354d14267e804ab64872af97b40.tar.xz
third_party-func-b3c5591d70c1c354d14267e804ab64872af97b40.zip
All exceptions, async or otherwise, now come back as easily detectable signatures. Use utils.is_error(result)
to determine if something is an error or isn't. Example scripts as well as func-inventory have been updated. See async_test.py for examples.
Diffstat (limited to 'func/overlord/client.py')
-rwxr-xr-xfunc/overlord/client.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/func/overlord/client.py b/func/overlord/client.py
index f33bc4b..e293f1c 100755
--- a/func/overlord/client.py
+++ b/func/overlord/client.py
@@ -25,7 +25,7 @@ import command
import groups
import func.forkbomb as forkbomb
import func.jobthing as jobthing
-
+import func.utils as utils
# ===================================
# defaults
@@ -132,7 +132,7 @@ def isServer(server_string):
class Client(object):
def __init__(self, server_spec, port=DEFAULT_PORT, interactive=False,
- verbose=False, noglobs=False, nforks=1, config=None, async=False, noexceptions=True):
+ verbose=False, noglobs=False, nforks=1, config=None, async=False):
"""
Constructor.
@server_spec -- something like "*.example.org" or "foosball"
@@ -153,7 +153,6 @@ class Client(object):
self.noglobs = noglobs
self.nforks = nforks
self.async = async
- self.noexceptions= noexceptions
self.servers = expand_servers(self.server_spec, port=self.port, noglobs=self.noglobs,verbose=self.verbose)
@@ -234,12 +233,11 @@ class Client(object):
if self.interactive:
print retval
except Exception, e:
- retval = e
+ (t, v, tb) = sys.exc_info()
+ retval = utils.nice_exception(t,v,tb)
if self.interactive:
sys.stderr.write("remote exception on %s: %s\n" %
(server, str(e)))
- if self.noglob and not self.noexceptions:
- raise(e)
if self.noglobs:
return retval