diff --git a/bcfg2/plugins/Python.py b/bcfg2/plugins/Python.py index 305e3dc9..b614bf3a 100644 --- a/bcfg2/plugins/Python.py +++ b/bcfg2/plugins/Python.py @@ -142,17 +142,17 @@ class Python(Bcfg2.Server.Plugin.Plugin,Bcfg2.Server.Plugin.Generator): text = pygen.generate(code, env, logger) except Exception, e: log_traceback(fname, 'exec', e) - raise Bcfg2.Server.Plugin.PluginExecutionError - info = env["info"] - if info.get('encoding', '') == 'base64': - text = binascii.b2a_base64(text) + raise Bcfg2.Server.Plugin.PluginExecutionError + info = env["info"] + if info.get('encoding', '') == 'base64': + text = binascii.b2a_base64(text) # lxml n'accepte que de l'ascii ou de l'unicode try: entry.text = text.decode("UTF-8") except: # solution de fallback entry.text = text.decode("ISO8859-15") - debug(entry.text) + debug(entry.text) entry.attrib['owner'] = info.get('owner', 'root') entry.attrib['group'] = info.get('group', 'root') entry.attrib['perms'] = oct(info.get('perms', 0644))