[entropy.client.interfaces.trigger] fix external script file execution

This commit is contained in:
Fabio Erculiani
2009-10-05 14:03:27 +02:00
parent 1293c84a7c
commit 2b8e5d366e
@@ -368,7 +368,8 @@ class Trigger:
def run(self, stage, pkgdata, trigger_file):
my_ext_status = 1
if os.path.isfile(trigger_file):
exec(compile(open(trigger_file).read(), trigger_file, 'exec'))
with open(trigger_file) as trig_f:
exec(compile(trig_f.read(), trigger_file, 'exec'))
if os.path.isfile(trigger_file):
os.remove(trigger_file)
return my_ext_status