[svn-commits] pabelanger: branch pabelanger/modules_check r1859 - /asterisk/team/pabelanger...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Aug 16 16:04:38 CDT 2011


Author: pabelanger
Date: Tue Aug 16 16:04:34 2011
New Revision: 1859

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1859
Log:
Version 2: Feedback from russellb

Modified:
    asterisk/team/pabelanger/modules_check/runtests.py

Modified: asterisk/team/pabelanger/modules_check/runtests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/modules_check/runtests.py?view=diff&rev=1859&r1=1858&r2=1859
==============================================================================
--- asterisk/team/pabelanger/modules_check/runtests.py (original)
+++ asterisk/team/pabelanger/modules_check/runtests.py Tue Aug 16 16:04:34 2011
@@ -71,9 +71,7 @@
                 print "Unknown custom dependency - '%s'" % self.name
         elif "asterisk" in dep:
             self.name = dep["asterisk"]
-            # XXX TODO Hard coded path, gross.
-            module = "%s/%s.so" % ("/usr/lib/asterisk/modules", self.name)
-            self.met = os.path.isfile(module)
+            self.met = self.__find_asterisk_module(self.name)
 
         else:
             print "Unknown dependency type specified."
@@ -110,20 +108,27 @@
 
     def depend_fax(self):
         fax_providers = [
-            "app_fax.so",
-            "res_fax_spandsp.so",
-            "res_fax_digium.so",
+            "app_fax",
+            "res_fax_spandsp",
+            "res_fax_digium",
         ]
+
+        for f in fax_providers:
+            if self.__find_asterisk_module(f):
+                return True
+
+        return False
+
+    def __find_asterisk_module(self, name):
         ast = Asterisk()
-
         if "astmoddir" not in ast.directories:
             return False
-        for f in fax_providers:
-            if os.path.exists("%s/%s" % (ast.directories["astmoddir"], f)):
-                return True
+
+        module = "%s/%s.so" % (ast.directories["astmoddir"], name)
+        if os.path.exists(module):
+            return True
 
         return False
-
 
 class TestConfig:
     def __init__(self, test_name, ast_version, options):




More information about the svn-commits mailing list