[asterisk-commits] pabelanger: branch pabelanger/sipp r1102 - in /asterisk/team/pabelanger/sipp:...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 7 15:07:51 CST 2010


Author: pabelanger
Date: Tue Dec  7 15:07:47 2010
New Revision: 1102

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1102
Log:
Final fixes, incoming reviewboard

Modified:
    asterisk/team/pabelanger/sipp/lib/python/sipp/version.py
    asterisk/team/pabelanger/sipp/runtests.py

Modified: asterisk/team/pabelanger/sipp/lib/python/sipp/version.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/sipp/lib/python/sipp/version.py?view=diff&rev=1102&r1=1101&r2=1102
==============================================================================
--- asterisk/team/pabelanger/sipp/lib/python/sipp/version.py (original)
+++ asterisk/team/pabelanger/sipp/lib/python/sipp/version.py Tue Dec  7 15:07:47 2010
@@ -26,23 +26,25 @@
         Keyword Arguments:
         version -- The SIPp version string to parse.
         """
+        self.version_str = ""
         if version is not None:
             self.version_str = version
         else:
-            cmd = [
-                utils.which("sipp"), "-v"
-            ]
-            try:
-                p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+            sipp = utils.which("sipp")
+            if sipp:
+                cmd = [
+                    sipp, "-v"
+                ]
+                try:
+                    p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                         stderr=subprocess.STDOUT)
-            except OSError:
-                return
-            #XXX TODO: Improve logic
-            for line in p.stdout:
-                if line.strip().startswith('SIPp'):
-                    x = line.strip().lstrip('SIPp ')
-                    x = x.split(',', 1)
-                    self.version_str = x[0]
+                except OSError:
+                    return
+                for line in p.stdout:
+                    if line.strip().startswith('SIPp'):
+                        ver = line.strip().lstrip('SIPp ')
+                        ver = ver.split(',', 1)
+                        self.version_str = ver[0]
 
         if not self.version_str:
             return

Modified: asterisk/team/pabelanger/sipp/runtests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/sipp/runtests.py?view=diff&rev=1102&r1=1101&r2=1102
==============================================================================
--- asterisk/team/pabelanger/sipp/runtests.py (original)
+++ asterisk/team/pabelanger/sipp/runtests.py Tue Dec  7 15:07:47 2010
@@ -45,8 +45,9 @@
         elif "sipp" in dep:
             self.name = "SIPp"
             self.version = SIPpVersion(dep["sipp"])
-            if (self.sipp_version > self.version):
-                self.met = True
+            if str(self.sipp_version):
+                if self.sipp_version > self.version:
+                    self.met = True
 
         elif "custom" in dep:
             self.name = dep["custom"]
@@ -277,7 +278,7 @@
             for d in t.deps:
                 if d.version:
                     print "      --> Dependency: %s" % (d.name)
-                    print "        --> Version: %s -- Met %s" % (d.version,
+                    print "        --> Version: %s -- Met: %s" % (d.version,
                             str(d.met))
                 else:
                     print "      --> Dependency: %s -- Met: %s" % (d.name,




More information about the asterisk-commits mailing list