clusterjob/__init__.py
def _run_prologue(self):
        """Render and run the prologue script"""
        if self.prologue is not None:
            prologue = self.render_script(self.prologue)
            with tempfile.NamedTemporaryFile('w', delete=False) as prologue_fh:
                prologue_fh.write(prologue)
                tempfilename = prologue_fh.name
            set_executable(tempfilename)
            try:
                sp.check_output( [tempfilename, ], stderr=sp.STDOUT)
            except sp.CalledProcessError as e:
                logger = logging.getLogger(__name__)
                logger.error(r'''
                Prologue script did not exit cleanly.
                CWD: {cwd}
                prologue: ---
                {prologue}
                ---
                response: ---
                {response}
                ---
                '''.format(cwd=os.getcwd(), prologue=self.prologue,
                           response=e.output))
                raise
            finally:
                os.unlink(tempfilename)
Render and run the prologue script
Render and run the prologue script
Render and run the prologue script
def _run_prologue(self):
        if self.prologue is not None:
            prologue = self.render_script(self.prologue)
            with tempfile.NamedTemporaryFile('w', delete=False) as prologue_fh:
                prologue_fh.write(prologue)
                tempfilename = prologue_fh.name
            set_executable(tempfilename)
            try:
                sp.check_output( [tempfilename, ], stderr=sp.STDOUT)
            except sp.CalledProcessError as e:
                logger = logging.getLogger(__name__)
                logger.error(r'''
                Prologue script did not exit cleanly.
                CWD: {cwd}
                prologue: ---
                {prologue}
                ---
                response: ---
                {response}
                ---
                '''.format(cwd=os.getcwd(), prologue=self.prologue,
                           response=e.output))
                raise
            finally:
                os.unlink(tempfilename)
def _run_prologue ( self ) : if self . prologue is not None : prologue = self . render_script ( self . prologue ) with tempfile . NamedTemporaryFile ( 'w' , delete = False ) as prologue_fh : prologue_fh . write ( prologue ) tempfilename = prologue_fh . name set_executable ( tempfilename ) try : sp . check_output ( [ tempfilename , ] , stderr = sp . STDOUT ) except sp . CalledProcessError as e : logger = logging . getLogger ( __name__ ) logger . error ( r'''
                Prologue script did not exit cleanly.
                CWD: {cwd}
                prologue: ---
                {prologue}
                ---
                response: ---
                {response}
                ---
                ''' . format ( cwd = os . getcwd ( ) , prologue = self . prologue , response = e . output ) ) raise finally : os . unlink ( tempfilename )
Render and run the prologue script
Render and run the prologue script
"""Render and run the prologue script"""
self