update environment with messages environment

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
Nico Schottelius 2013-12-03 14:36:38 +01:00
parent 2f842d56eb
commit 90896a9e06
2 changed files with 3 additions and 0 deletions

View file

@ -168,6 +168,7 @@ class Local(object):
if message_prefix:
message = cdist.message.Message(message_prefix, self.messages_path)
env.update(message.env)
try:
if return_output:

View file

@ -56,12 +56,14 @@ class Message(object):
shutil.copyfile(self.global_messages, self.messages_in)
def _cleanup(self):
"""remove temporary files"""
if os.path.exists(self.messages_in):
os.remove(self.messages_in)
if os.path.exists(self.messages_out):
os.remove(self.messages_out)
def _merge_messages(self):
"""merge newly written lines into global file"""
with open(self.messages_out) as fd:
content = fd.readlines()