diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2007-12-17 12:58:22 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2007-12-17 12:58:22 -0500 |
commit | deb92cf93060efd598e86e810aa52bc1b659c9bc (patch) | |
tree | 3163358e061dffe693892a1300e5d0e32af06ceb /func | |
parent | 9806fbbebb7d9e28cc58ab5388ad646ffbf7ebb6 (diff) | |
download | func-deb92cf93060efd598e86e810aa52bc1b659c9bc.tar.gz func-deb92cf93060efd598e86e810aa52bc1b659c9bc.tar.xz func-deb92cf93060efd598e86e810aa52bc1b659c9bc.zip |
Make func-inventory work again, although more needs to be done to tolerate systems that can't be connected to.
Diffstat (limited to 'func')
-rwxr-xr-x | func/overlord/client.py | 2 | ||||
-rwxr-xr-x | func/overlord/inventory.py | 50 |
2 files changed, 25 insertions, 27 deletions
diff --git a/func/overlord/client.py b/func/overlord/client.py index 47ab50c..c6d8ab6 100755 --- a/func/overlord/client.py +++ b/func/overlord/client.py @@ -228,7 +228,7 @@ class Client(object): # globbing is not being used, but still need to make sure # URI is well formed. expanded = expand_servers(self.server_spec, port=self.port, noglobs=True, verbose=self.verbose)[0] - process_server(0, 0, expanded) + results = process_server(0, 0, expanded) return results diff --git a/func/overlord/inventory.py b/func/overlord/inventory.py index 28a269e..bd5c934 100755 --- a/func/overlord/inventory.py +++ b/func/overlord/inventory.py @@ -79,37 +79,35 @@ class FuncInventory(object): self.git_setup(options) # see what modules each host provides (as well as what hosts we have) - host_modules = func_client.Client(options.server_spec).system.list_modules() + host_methods = func_client.Client(options.server_spec).system.list_methods() + + # 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(): - if type(modules) != list: - if options.verbose: - print "-- connection refused: %s" % host - continue - else: + # for (host, modules) in host_modules.iteritems(): + + for (host, methods) in host_methods.iteritems(): + + for each_method in methods: + if options.verbose: - print "-- connected: %s" % host - - for module_name in modules: - if ("all" in filtered_module_list) or (module_name in filtered_module_list): - if options.verbose: - print "---- scanning module: %s" % module_name - host_module = getattr(func_client.Client(host,noglobs=True),module_name) - if options.verbose: - print "--- DEBUG: remote module: %s" % host_module - - remote_methods = host_module.list_methods() - if options.verbose: - print "--- DEBUG: available remote methods: %s" % remote_methods - for remote_method in remote_methods: - if ("all" in filtered_function_list) or (remote_method in filtered_function_list): - if options.verbose: - print "------ adding to inventory: %s/%s" % (module_name, remote_method) - results = getattr(host_module, remote_method)() - self.save_results(options, host, module_name, remote_method, results) + print "-- analyzing: %s" % each_method + (module_name, method_name) = each_method.split(".") + + if not "all" in filtered_module_list and not module_name in filtered_module_list: + continue + + if not "all" in filtered_function_list and not method_name in filtered_function_list: + continue + + client = func_client.Client(host,noglobs=True) # ,noglobs=True) + results = getattr(getattr(client,module_name),method_name)() + if self.options.verbose: + print "DEBUG: results=%s" % results + self.save_results(options, host, module_name, method_name, results) self.git_update(options) return 1 |