[asterisk-commits] mjordan: branch mjordan/noversioncheck r3197 - /asterisk/team/mjordan/noversi...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 19 14:43:24 CDT 2012


Author: mjordan
Date: Thu Apr 19 14:43:21 2012
New Revision: 3197

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3197
Log:
Remove version checks from asterisk module

Modified:
    asterisk/team/mjordan/noversioncheck/lib/python/asterisk/asterisk.py

Modified: asterisk/team/mjordan/noversioncheck/lib/python/asterisk/asterisk.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/noversioncheck/lib/python/asterisk/asterisk.py?view=diff&rev=3197&r1=3196&r2=3197
==============================================================================
--- asterisk/team/mjordan/noversioncheck/lib/python/asterisk/asterisk.py (original)
+++ asterisk/team/mjordan/noversioncheck/lib/python/asterisk/asterisk.py Thu Apr 19 14:43:21 2012
@@ -183,7 +183,7 @@
         self.asterisk = Asterisk(base="manager/login")
         """
         self.directories = {}
-        self.ast_version = AsteriskVersion()
+        #self.ast_version = AsteriskVersion()
         self.base = Asterisk.test_suite_root
         if base is not None:
             self.base = "%s/%s" % (self.base, base)
@@ -290,10 +290,10 @@
 
         def __send_stop_gracefully():
             """ Send a core stop gracefully CLI command """
-            if self.ast_version < AsteriskVersion("1.6.0"):
-                cli_deferred = self.cli_exec("stop gracefully")
-            else:
-                cli_deferred = self.cli_exec("core stop gracefully")
+            #if self.ast_version < AsteriskVersion("1.6.0"):
+            #    cli_deferred = self.cli_exec("stop gracefully")
+            #else:
+            cli_deferred = self.cli_exec("core stop gracefully")
             cli_deferred.addCallbacks(__stop_gracefully_callback, __stop_gracefully_error)
 
         def __stop_gracefully_callback(cli_command):
@@ -313,10 +313,10 @@
 
         def __send_stop_now():
             """ Send a core stop now CLI command """
-            if self.ast_version < AsteriskVersion("1.6.0"):
-                cli_deferred = self.cli_exec("stop now")
-            else:
-                cli_deferred = self.cli_exec("core stop now")
+            #if self.ast_version < AsteriskVersion("1.6.0"):
+            #    cli_deferred = self.cli_exec("stop now")
+            #else:
+            cli_deferred = self.cli_exec("core stop now")
             if cli_deferred:
                 cli_deferred.addCallbacks(__stop_now_callback, __stop_now_error)
 
@@ -468,9 +468,9 @@
             logger.error("Config file '%s' does not exist" % cfg_path)
             return
 
-        tmp = "%s/%s/%s" % (os.path.dirname(cfg_path), self.ast_version.branch, os.path.basename(cfg_path))
-        if os.path.exists(tmp):
-            cfg_path = tmp
+        #tmp = "%s/%s/%s" % (os.path.dirname(cfg_path), self.ast_version.branch, os.path.basename(cfg_path))
+        #if os.path.exists(tmp):
+        #    cfg_path = tmp
         target_path = os.path.join(self.astetcdir, os.path.basename(cfg_path))
         if os.path.exists(target_path):
             os.remove(target_path)
@@ -544,10 +544,10 @@
             <tech/data> application <appname> appdata\n\
             <tech/data> extension <exten>@<context>"
 
-        if self.ast_version < AsteriskVersion("1.6.2"):
-            return self.cli_exec("originate %s" % argstr, blocking=blocking)
-        else:
-            return self.cli_exec("channel originate %s" % argstr, blocking=blocking)
+        #if self.ast_version < AsteriskVersion("1.6.2"):
+        #    return self.cli_exec("originate %s" % argstr, blocking=blocking)
+        #else:
+        return self.cli_exec("channel originate %s" % argstr, blocking=blocking)
 
     def cli_exec(self, cli_cmd, blocking=True, warn_on_fail=True):
         """Execute a CLI command on this instance of Asterisk.




More information about the asterisk-commits mailing list