def _write_executor_script(self, ostr):
environment = self.execution.get('<STR_LIT>') or {}<EOL>if not isinstance(environment, Mapping):<EOL><INDENT>msg = '<STR_LIT>'<EOL>msg += str(type(environment))<EOL>raise Exception(msg)<EOL><DEDENT>escaped_environment = dict(<EOL>(var, six.moves.shlex_quote(str(value)))<EOL>for var, value in environment.items()<EOL>)<EOL>modules = self.execution.get('<STR_LIT>') or []<EOL>properties = dict(<EOL>command=self.command,<EOL>cwd=os.getcwd(),<EOL>modules=modules,<EOL>environment=escaped_environment,<EOL>)<EOL>self._jinja_executor_template.stream(**properties).dump(ostr)<EOL>
Write shell script in charge of executing the command