[asterisk-bugs] [Asterisk 0011442]: duplicate values when rewriting templated config files

noreply at bugs.digium.com noreply at bugs.digium.com
Wed Mar 19 01:41:57 CDT 2008


The following issue requires your FEEDBACK. 
====================================================================== 
http://bugs.digium.com/view.php?id=11442 
====================================================================== 
Reported By:                tzafrir
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   11442
Category:                   Core/Configuration
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:            1.4.14  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             12-03-2007 06:02 CST
Last Modified:              03-19-2008 01:41 CDT
====================================================================== 
Summary:                    duplicate values when rewriting templated config
files
Description: 
I'm trying to generate slimmer config files using templates.

I use something of the sort of:

[master-template](!)
mastervar = bar
[template](!,master-template)
tvar = value
[cat](template)
catvar = val

I do not expect full transparent rewrite support of this. I do hope to get
at least some "flattening" of the templates that will preserve the values:


[cat]
mastervar = bar
tvar = value
catvar = val


What I actually get is: 

After first save/rewrite:

[master-template](!)
mastervar = bar
[template](!)(master-template)
mastervar = bar
tvar = value
[cat](template)
mastervar = bar
tvar = value
catvar = val

And then after the second time those values get rewritten to the
configuration file by Asterisk, they end up as:

[master-template](!)
mastervar = bar
[template](!)
mastervar = bar
tvar = value
[cat](template)
mastervar = bar
tvar = value
mastervar = bar
tvar = value
catvar = val
====================================================================== 

---------------------------------------------------------------------- 
 murf - 03-19-08 01:41  
---------------------------------------------------------------------- 
Tzafrir--

OK, I've attached a patch for 1.4; I think it solves all the problems you
presented:

1. Bad syntax in printing the category template references; does not do
multiple sets of (<whatever>); it now does [catname](!,whatever,whatnot)
instead.
2. There was code there to search the template refs for the same var=val
decl. But it didn't work because the underlying code was built to ignore
categories marked ignore (!). So, I coded around that.

Please try out the patch, and maybe tomorrow I can commit it to 1.4,
trunk, and 1.6. My own tests using your examples works OK...


 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
03-19-08 01:41  murf           Note Added: 0084226                          
03-19-08 01:41  murf           Status                   assigned => feedback
======================================================================




More information about the asterisk-bugs mailing list