[asterisk-commits] mjordan: testsuite/asterisk/trunk r2697 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 8 17:02:02 CST 2011


Author: mjordan
Date: Tue Nov  8 17:01:59 2011
New Revision: 2697

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2697
Log:
Cleaned up some of the defensive coding checks per mnicholson

Modified:
    asterisk/trunk/lib/python/asterisk/asterisk.py

Modified: asterisk/trunk/lib/python/asterisk/asterisk.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/asterisk.py?view=diff&rev=2697&r1=2696&r2=2697
==============================================================================
--- asterisk/trunk/lib/python/asterisk/asterisk.py (original)
+++ asterisk/trunk/lib/python/asterisk/asterisk.py Tue Nov  8 17:01:59 2011
@@ -115,10 +115,8 @@
         Note that calling this will install the default testsuite
         config files, if they have not already been installed
         """
-        if self.__configs_installed == False:
-            self.install_configs(os.getcwd() + "/configs")
-        if self.__configs_set_up == False:
-            self.__setup_configs()
+        self.install_configs(os.getcwd() + "/configs")
+        self.__setup_configs()
 
         cmd = [
             self.ast_binary,
@@ -215,13 +213,14 @@
         if they have not already been installed.
         """
 
-        if not self.__directory_structure_made:
-            self.__make_directory_structure()
-
-        if not self.__configs_installed:
-            if cfg_path != ("%s/configs" % os.getcwd()):
-                """ Do a one-time installation of the base configs """
-                self.install_configs("%s/configs" % os.getcwd())
+        self.__make_directory_structure()
+
+        if self.__configs_installed and cfg_path == ("%s/configs" % os.getcwd()):
+            return
+
+        if not self.__configs_installed and cfg_path != ("%s/configs" % os.getcwd()):
+            """ Do a one-time installation of the base configs """
+            self.install_configs("%s/configs" % os.getcwd())
             self.__configs_installed = True
 
         for f in os.listdir(cfg_path):
@@ -412,7 +411,10 @@
         Perform any post-installation manipulation of the config
         files
         """
+        if self.__configs_set_up:
+            return
         self.__setup_manager_conf()
+        self.__configs_set_up = True
 
     def __setup_manager_conf(self):
         values = []




More information about the asterisk-commits mailing list