diff options
author | gthielebein <gthielebein@lxp01-eeepc.(none)> | 2010-12-15 20:59:19 +0100 |
---|---|---|
committer | gthielebein <gthielebein@lxp01-eeepc.(none)> | 2010-12-15 20:59:19 +0100 |
commit | c23d576736461f751cb8faf4d27388842f76f2d7 (patch) | |
tree | e98ec26e943df315f529f1b8ca45a784bc4f4dc7 /doc | |
parent | e04db5c4f3735161802ca70bc4fe94c8ab463983 (diff) | |
download | bcfg2-c23d576736461f751cb8faf4d27388842f76f2d7.tar.gz bcfg2-c23d576736461f751cb8faf4d27388842f76f2d7.tar.bz2 bcfg2-c23d576736461f751cb8faf4d27388842f76f2d7.zip |
Update TCheetah plugins usage
Diffstat (limited to 'doc')
-rw-r--r-- | doc/server/plugins/generators/tcheetah.txt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/doc/server/plugins/generators/tcheetah.txt b/doc/server/plugins/generators/tcheetah.txt index 185b25ef5..5819bba96 100644 --- a/doc/server/plugins/generators/tcheetah.txt +++ b/doc/server/plugins/generators/tcheetah.txt @@ -28,7 +28,7 @@ files, ``template`` and ``info``. The template is a standard Cheetah template with two additions: * `self.metadata` is the client's :ref:`metadata <server-plugins-grouping-metadata-clientmetadata>` -* `self.properties` is an xml document of unstructured data +* `self.metadata.Properties` is an xml document of unstructured data The ``info`` file is formatted like ``:info`` files from Cfg. @@ -47,8 +47,8 @@ self.metadata variables self.metadata is an instance of the class ClientMetadata and documented :ref:`here <server-plugins-grouping-metadata-clientmetadata>`. -self.properties -=============== +self.metadata.Properties +======================== Properties is a python `ElementTree <http://codespeak.net/lxml/>`_ object, loaded from the data in ``/var/lib/bcfg2/Properties/<properties @@ -70,13 +70,13 @@ You may use any of the ElementTree methods to access data in your template. Several examples follow, each producing an identical result on the host 'www.example.com':: - $self.Properties['example.xml'].find('host').find('www.example.com').find('rootdev').text - $self.Properties['example.xml'].find('host').find($self.metadata.hostname).find('rootdev').text - ${self.Properties['example.xml'].xpath('host/www.example.com/rootdev')[0].text} - ${self.Properties['example.xml'].xpath('host/' + self.metadata.hostname + '/rootdev')[0].text} + $self.metadata.Properties['example.xml'].data.find('host').find('www.example.com').find('rootdev').text + $self.metadata.Properties['example.xml'].data.find('host').find($self.metadata.hostname).find('rootdev').text + ${self.metadata.Properties['example.xml'].data.xpath('host/www.example.com/rootdev')[0].text} + ${self.metadata.Properties['example.xml'].data.xpath('host/' + self.metadata.hostname + '/rootdev')[0].text} #set $path = 'host/' + $self.metadata.hostname + '/rootdev' - ${self.Properties['example.xml'].xpath($path)[0].text} - ${self.Properties['example.xml'].xpath(path)[0].text} + ${self.metadata.Properties['example.xml'].data.xpath($path)[0].text} + ${self.metadata.Properties['example.xml'].data.xpath(path)[0].text} Simple Example ============== |