diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-01-29 16:19:30 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-01-29 16:19:30 -0500 |
commit | b3c5591d70c1c354d14267e804ab64872af97b40 (patch) | |
tree | a361f4d0ea060df23ffbccf9961f38bb01a65d23 /func/overlord/inventory.py | |
parent | 1d60f197dab809e9a51c3377587d46370e698c52 (diff) | |
download | third_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/inventory.py')
-rwxr-xr-x | func/overlord/inventory.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/func/overlord/inventory.py b/func/overlord/inventory.py index 47fff6a..c2a1d30 100755 --- a/func/overlord/inventory.py +++ b/func/overlord/inventory.py @@ -21,8 +21,8 @@ import sys import pprint import xmlrpclib from func.minion import sub_process - import func.overlord.client as func_client +import func.utils as utils DEFAULT_TREE = "/var/lib/func/inventory/" @@ -80,19 +80,21 @@ class FuncInventory(object): # call all remote info methods and handle them if options.verbose: - # print "- DEBUG: %s" % host_methods print "- scanning ..." # for (host, modules) in host_modules.iteritems(): for (host, methods) in host_methods.iteritems(): - - for each_method in methods: + if utils.is_error(methods): + print "-- connection refused: %s" % host + break + + for each_method in methods: - if type(each_method) == int: - if self.options.verbose: - print "-- connection refused: %s" % host - break + #if type(each_method) == int: + # if self.options.verbose: + # print "-- connection refused: %s" % host + # break (module_name, method_name) = each_method.split(".") |