summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2011-03-16 07:57:25 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2011-03-16 07:57:25 -0400
commit0984e097c2f7d973320fa14fcfab36d3122cfaf0 (patch)
tree89c3e18d9354ca04511cb6b15686e0e3e83e2666 /src/lib
parent3c290811195e23c9a948ac15c304b34ea16fbe9b (diff)
downloadbcfg2-0984e097c2f7d973320fa14fcfab36d3122cfaf0.tar.gz
bcfg2-0984e097c2f7d973320fa14fcfab36d3122cfaf0.tar.bz2
bcfg2-0984e097c2f7d973320fa14fcfab36d3122cfaf0.zip
In TGenshi templates, the "name" variable is set to the destination path of the file. If an altsrc attribute was used, then "name" is set to the altsrc value; otherwise, it is set to the "name" attribute of the original <Path> tag used to declare the file. In the new Genshi handler functionality of Cfg, this had not been ported over; "name" was always the original name of the file, even if altsrc was specified. Fixed that bug.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/Cfg.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/Server/Plugins/Cfg.py b/src/lib/Server/Plugins/Cfg.py
index 585f4f6ac..184bb792c 100644
--- a/src/lib/Server/Plugins/Cfg.py
+++ b/src/lib/Server/Plugins/Cfg.py
@@ -122,10 +122,11 @@ class CfgEntrySet(Bcfg2.Server.Plugin.EntrySet):
template_cls = NewTextTemplate
loader = TemplateLoader()
template = loader.load(basefile.name, cls=template_cls,
- encoding=self.encoding)
- stream = template.generate( \
- name=entry.get('name'), metadata=metadata,
- path=basefile.name).filter(removecomment)
+ encoding=self.encoding)
+ fname = entry.get('realname', entry.get('name'))
+ stream = template.generate(name=fname,
+ metadata=metadata,
+ path=basefile.name).filter(removecomment)
try:
data = stream.render('text', strip_whitespace=False)
except TypeError: