[asterisk-bugs] [Asterisk 0008786]: [patch] Properly handle tempates on config read/write

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Nov 2 13:11:55 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=8786 
====================================================================== 
Reported By:                ssokol
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   8786
Category:                   Core/Configuration
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4 
SVN Revision (number only!): 49334 
Disclaimer on File?:        Yes 
Request Review:              
====================================================================== 
Date Submitted:             01-10-2007 13:17 CST
Last Modified:              11-02-2007 13:11 CDT
====================================================================== 
Summary:                    [patch] Properly handle tempates on config
read/write
Description: 
The configuration parser properly handles inherited properties from
templates when loading them from configuration files, but miss-handles them
when writing the configuration back to disk.

The attached patch denotes a context which has been built from a template
by automatically adding a variable called "inherited_" which is set to the
parent category name.  When the config handler writes the file, it checks
to see if a category is marked as inherited_ and if so, only writes those
values which are absent from the parent context.
====================================================================== 

---------------------------------------------------------------------- 
 ssokol - 11-02-07 13:11  
---------------------------------------------------------------------- 
No but you can test it on any box running the GUI.  Just create a template
user in users.conf as follows:

[foo](!)
test=yes
data=blahblah

Then edit a user created by the GUI by adding the template marker to it. 
For example:

[6000](foo)

Then fire up the GUI, load 6000 up, make a change and save it.  If the
patch is working correctly, when you look into the config you should see
the (foo) inheritance indicator still there and no "test" or "data" items
in the [6000] entity.  If its not working then you'll see [6000] with two
new key/value pairs: "test" and "data".

Thanks,

-S 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-02-07 13:11  ssokol         Note Added: 0072993                          
======================================================================




More information about the asterisk-bugs mailing list