From 52c87ed5293347531981392821f9409135bc4a40 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Sat, 9 Feb 2008 16:04:47 +0100 Subject: [PATCH] =?UTF-8?q?On=20ne=20plante=20pas=20si=20toutes=20les=20m?= =?UTF-8?q?=C3=A9tadonn=C3=A9es=20sur=20le=20fichier=20ne=20sont=20pas=20d?= =?UTF-8?q?=C3=A9finies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit darcs-hash:20080209150447-af139-54be5b9423daaefb6377da64b7918f7a7645a208.gz --- bcfg2/plugins/Python.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bcfg2/plugins/Python.py b/bcfg2/plugins/Python.py index 0ffa2cde..a4ea4553 100644 --- a/bcfg2/plugins/Python.py +++ b/bcfg2/plugins/Python.py @@ -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'''