Commit 52c87ed5 authored by Jeremie Dimino's avatar Jeremie Dimino

On ne plante pas si toutes les métadonnées sur le fichier ne sont pas définies

darcs-hash:20080209150447-af139-54be5b9423daaefb6377da64b7918f7a7645a208.gz
parent 0755e983
......@@ -144,14 +144,15 @@ class Python(Bcfg2.Server.Plugin.Plugin):
except Exception, e:
log_traceback(fname, 'exec', e)
raise Bcfg2.Server.Plugin.PluginExecutionError
if env["info"]['encoding'] == 'base64':
info = env["info"]
if info.get('encoding', 'base64') == 'base64':
text = binascii.b2a_base64(text)
entry.text = text
debug(entry.text)
entry.attrib['owner'] = env["info"]['owner']
entry.attrib['group'] = env["info"]['group']
entry.attrib['perms'] = oct(env["info"]['perms'])
entry.attrib['encoding'] = env["info"]['encoding']
entry.attrib['owner'] = info.get('owner', 'root')
entry.attrib['group'] = info.get('group', 'root')
entry.attrib['perms'] = oct(info.get('perms', 0644))
entry.attrib['encoding'] = info.get('encoding', 'base64')
def HandleEvent(self, event):
'''Traitement des événements de FAM'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment