Python 3: replace exec with six.exec_()

The "exec" statement was removed in Python 3. Replace it with
six.exec_() to add compatibility with Python 3.

Blueprint: murano-python-3-support
Change-Id: Idd1c6a6347e22f6a9c7887e7a327d29bb64e46d5
This commit is contained in:
Victor Stinner 2016-06-20 18:14:34 +02:00 committed by Kirill Zaitsev
parent c56acc78ae
commit c1c400f116
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@
import sys
import six
from muranoagent import bunch
from muranoagent import files_manager as fm
@ -34,7 +35,7 @@ class ExecutionPlanRunner(object):
"args": bunch.Bunch(self._execution_plan.get('Parameters') or {})
}
script_globals.update(self._script_funcs)
exec self._main_script in script_globals
six.exec_(self._main_script, script_globals)
if '__execution_plan_exception' in script_globals:
raise script_globals['__execution_plan_exception']
return script_globals['__execution_plan_result']