[bcfg2] s/\t/ /

darcs-hash:20110226110409-ffbb2-b40d9a357dcca67580a7e9c2593fc37572cf6503.gz
This commit is contained in:
Nicolas Dandrimont 2011-02-26 12:04:09 +01:00
parent 4bd528bd1e
commit 200a8f1bee

View file

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