[asterisk-commits] Realtime: Install modified configs in proper location. (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 3 06:18:02 CST 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: Realtime: Install modified configs in proper location.
......................................................................


Realtime: Install modified configs in proper location.

Oops.

As it turns out, automatic realtime conversion was not working as
expected. Specifically, vital Asterisk configuration files like
res_odbc.conf, extconfig.conf, and sorcery.conf were being written after
other configuration files had been installed into their runtime
location.

When performing tests during development, it happened to be that my
/etc/asterisk configuration directory was set perfectly to use realtime
configuration, so it appeared that automatic realtime conversion was
working as expected.

With this change, in addition to writing configuration files, we install
them into their runtime directory. It has been tested to work as
expected now.

Change-Id: I7f618a8b7e403317628a0d013c222f1a80495f02
---
M lib/python/asterisk/realtime_converter.py
1 file changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/lib/python/asterisk/realtime_converter.py b/lib/python/asterisk/realtime_converter.py
index 52de9d3..87bef09 100644
--- a/lib/python/asterisk/realtime_converter.py
+++ b/lib/python/asterisk/realtime_converter.py
@@ -88,7 +88,7 @@
         self.sorcery = None
         self.extconfig = None
 
-    def write_configs(self, config_dir):
+    def write_configs(self, config_dir, asterisk):
         """Write configuration for sorcery.
 
         This writes the sorcery.conf file and adds to the extconfig.conf file in
@@ -101,6 +101,8 @@
         self.extconfig = ConfigFile(config_dir, 'extconfig.conf')
         self.write_sorcery_conf()
         self.write_extconfig_conf()
+        asterisk.install_config(os.path.join(config_dir, 'sorcery.conf'))
+        asterisk.install_config(os.path.join(config_dir, 'extconfig.conf'))
 
     def write_sorcery_conf(self):
         """Write sorcery.conf file.
@@ -246,8 +248,14 @@
         self.write_extconfig_conf()
         self.write_res_odbc_conf(dsn, username, password)
         self.write_modules_conf()
+        test_object.ast[0].install_config(os.path.join(self.config_dir,
+                                                       'extconfig.conf'))
+        test_object.ast[0].install_config(os.path.join(self.config_dir,
+                                                       'res_odbc.conf'))
+        test_object.ast[0].install_config(os.path.join(self.config_dir,
+                                                       'modules.conf.inc'))
         for realtime_file in REALTIME_FILE_REGISTRY:
-            realtime_file.write_configs(self.config_dir)
+            realtime_file.write_configs(self.config_dir, test_object.ast[0])
 
         self.write_db()
 

-- 
To view, visit https://gerrit.asterisk.org/2148
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7f618a8b7e403317628a0d013c222f1a80495f02
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-commits mailing list