3 commits - func/minion func/utils.py

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

 



 func/minion/acls.py   |    2 +-
 func/minion/server.py |   14 +++++++-------
 func/utils.py         |   12 ++++++++----
 3 files changed, 16 insertions(+), 12 deletions(-)

New commits:
commit 9dfa5414b86bce5b3066d35d4e46ce482d21de0c
Author: Toshio Kuratomi <toshio@xxxxxxxxxxxxxxxxx>
Date:   Mon May 3 13:45:00 2010 -0400

    Remove an inner loop in system.inventory()

diff --git a/func/utils.py b/func/utils.py
index f184013..1c4d94c 100644
--- a/func/utils.py
+++ b/func/utils.py
@@ -57,10 +57,14 @@ def get_formated_jobid(**id_pack):
     return job_id
 
 def is_public_valid_method(obj, attr, blacklist=[]):
-    if inspect.ismethod(getattr(obj, attr)) and attr[0] != '_':
-        for b in blacklist:
-            if attr==b:
-                return False
+    # Note: the order can be important here.  func modules that try to inspect
+    # the list of available methods may run into inifinite recursion issues if
+    # getattr() is called on them.  They can work around this by placing the
+    # problematic code in a private method that's called from their public
+    # method if we perform the check for a leading underscore before the check
+    # that calls getattr()
+    if attr[0] != '_' and attr not in blacklist and \
+            inspect.ismethod(getattr(obj, attr)):
         return True
     return False
 


commit e3ae690e1f7421a12a2e53bafb35c4ab02ed67d1
Author: Toshio Kuratomi <toshio@xxxxxxxxxxxxxxxxx>
Date:   Mon May 3 13:44:47 2010 -0400

    Fix for potential infinite recursion

diff --git a/func/minion/server.py b/func/minion/server.py
index 101868d..0ee516e 100644
--- a/func/minion/server.py
+++ b/func/minion/server.py
@@ -139,13 +139,13 @@ class XmlRpcInterface(object):
         # see which are where, but that seems lame -akl
         for module in self.modules.keys():
             inventory[module] = []
-            for method in self.handlers.keys():
-                # string match, ick. 
-                method_bits = method.split('.')
-                method_module = string.join(method_bits[:-1], '.')
-                method_name = method_bits[-1]
-                if method_module == module:
-                    inventory[module].append(method_name)
+        for method in self.handlers.keys():
+            # string match, ick. 
+            method_bits = method.split('.')
+            method_module = string.join(method_bits[:-1], '.')
+            method_name = method_bits[-1]
+            if method_module in inventory:
+                inventory[module_module].append(method_name)
 
         return inventory
 


commit d0f8b76f02ef3cb844ab878d5a699fea0dd695ae
Author: Toshio Kuratomi <toshio@xxxxxxxxxxxxxxxxx>
Date:   Mon May 3 13:44:22 2010 -0400

    Fix for traceback in logger

diff --git a/func/minion/acls.py b/func/minion/acls.py
index 46ae9c2..fec3be0 100644
--- a/func/minion/acls.py
+++ b/func/minion/acls.py
@@ -46,7 +46,7 @@ class Acls(object):
         files = glob.glob(acl_glob)
     
         for acl_file in files:
-            self.logger.debug("acl_file", acl_file)
+            self.logger.debug("acl_file %s", acl_file)
             try:
                 fo = open(acl_file, 'r')
             except (IOError, OSError), e:


_______________________________________________
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