summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-05-31 10:36:15 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-05-31 10:36:15 -0500
commit1c10760466c83131a60b36a284c38c44ff4b73b8 (patch)
treee12b77d4a47bfd113d086a18acb5d9ae01546917
parentb808e63f6ea6c872503a648eec33cadaa512cc34 (diff)
downloadbcfg2-1c10760466c83131a60b36a284c38c44ff4b73b8.tar.gz
bcfg2-1c10760466c83131a60b36a284c38c44ff4b73b8.tar.bz2
bcfg2-1c10760466c83131a60b36a284c38c44ff4b73b8.zip
Cfg: Fix traceback for non-ascii files
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
-rw-r--r--doc/help/troubleshooting.txt6
-rw-r--r--src/lib/Server/Plugins/Cfg.py7
2 files changed, 13 insertions, 0 deletions
diff --git a/doc/help/troubleshooting.txt b/doc/help/troubleshooting.txt
index 010c80de5..ecf53527c 100644
--- a/doc/help/troubleshooting.txt
+++ b/doc/help/troubleshooting.txt
@@ -162,6 +162,10 @@ be taken to remedy them.
| dependency. Shutting | | import lxml | |
| down server. | | | |
+------------------------------+----------+---------------------+--------------+
+| You need to specify base64 | Server | The server cannot | [15]_ |
+| encoding for <path> | | send the file as | |
+| | | ascii text | |
++------------------------------+----------+---------------------+--------------+
.. [1] This entry is not being bound. Ensure that a version of this
@@ -201,6 +205,8 @@ be taken to remedy them.
specified as a BoundPackage entry).
.. [14] Ensure that you have installed all the necessary
:ref:`installation-prerequisites`.
+.. [15] You likely need to specify a base64 encoding using an
+ :ref:`server-info` file for this entry.
FAQs
====
diff --git a/src/lib/Server/Plugins/Cfg.py b/src/lib/Server/Plugins/Cfg.py
index 832f7ab41..5e3cca847 100644
--- a/src/lib/Server/Plugins/Cfg.py
+++ b/src/lib/Server/Plugins/Cfg.py
@@ -162,6 +162,13 @@ class CfgEntrySet(Bcfg2.Server.Plugin.EntrySet):
logger.error("Failed to decode %s: %s" % (entry.get('name'), e))
logger.error("Please verify you are using the proper encoding.")
raise Bcfg2.Server.Plugin.PluginExecutionError
+ except ValueError:
+ e = sys.exc_info()[1]
+ logger.error("Error in specification for %s" % entry.get('name'))
+ logger.error("%s" % e)
+ logger.error("You need to specify base64 encoding for %s." %
+ entry.get('name'))
+ raise Bcfg2.Server.Plugin.PluginExecutionError
if entry.text in ['', None]:
entry.set('empty', 'true')