[PATCH 1/2] make sure when we get back errors connecting to list grep modules that we do something intelligent with them

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 func/overlord/cmd_modules/grep.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/func/overlord/cmd_modules/grep.py b/func/overlord/cmd_modules/grep.py
index b7f1ac5..dc6bb5f 100644
--- a/func/overlord/cmd_modules/grep.py
+++ b/func/overlord/cmd_modules/grep.py
@@ -15,6 +15,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 import pprint
 import sys
+import types
 
 from func.overlord import client
 from func.overlord import base_command
@@ -136,8 +137,12 @@ class Grep(base_command.BaseCommand):
             module_methods = self.overlord_obj.system.inventory()
 
             for hn in module_methods:
+               if type(module_methods[hn]) != types.DictType:
+                   sys.stderr.write("Error on host %s: %s" % (hn, ' '.join(module_methods[hn])))
+                   continue
+
                 for module in module_methods[hn]:
-                # searching for "grep"? meta
+                    # searching for "grep"? meta
                     if "grep" in module_methods[hn][module]:
                         if not host_modules.has_key(host):
                             host_modules[host] = []
-- 
1.6.6

_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list

[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux