diff options
author | Tim Laszlo <tim.laszlo@gmail.com> | 2010-07-19 14:47:42 +0000 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2010-07-30 11:53:15 -0500 |
commit | fbfce6b96a23873e85fd249cd15ee25224797c69 (patch) | |
tree | e94f69a82e0393bfcf2cf1b26eae07eb7d6ee913 | |
parent | c2083e07904691dab557bc68838299b2716846ae (diff) | |
download | bcfg2-fbfce6b96a23873e85fd249cd15ee25224797c69.tar.gz bcfg2-fbfce6b96a23873e85fd249cd15ee25224797c69.tar.bz2 bcfg2-fbfce6b96a23873e85fd249cd15ee25224797c69.zip |
Doc: Added error handling info to TGenshi docs
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5981 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r-- | doc/server/plugins/generators/tgenshi/index.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/server/plugins/generators/tgenshi/index.txt b/doc/server/plugins/generators/tgenshi/index.txt index 57440f6df..7eab9dba5 100644 --- a/doc/server/plugins/generators/tgenshi/index.txt +++ b/doc/server/plugins/generators/tgenshi/index.txt @@ -136,6 +136,33 @@ File permissions for entries handled by TGenshi are controlled via the use of :ref:`server-info` files. Note that you **cannot** use both a Permissions entry and a Path entry to handle the same file. +Error handling +================ + +Situations may arrise where a templated file cannot be generated due to +missing or incomplete information. A TemplateError can be raised to +force a bind failure and prevent sending an incomplete file to the client. +For example, this template:: + + {% python + from genshi.template import TemplateError + grp = None + for g in metadata.groups: + if g.startswith('ganglia-gmond-'): + grp = g + break + else: + raise TemplateError, "Missing group" + %}\ + +will fail to bind if the client is not a member of a group starting with +"ganglia-gmond-". The syslogs on the server will contain this message:: + + bcfg2-server[5957]: Genshi template error: Missing group + bcfg2-server[5957]: Failed to bind entry: Path /etc/ganglia/gmond.conf + +indicating the bind failure and message raised with the TemplateError. + FAQs ==== |