Run cleanup script of pipeline when hook is configured.
338258
def cleanup(self):
        """"""
        if self.data.hooks and len(self.data.hooks.cleanup) > 0:
            env = self.data.env_list[0].copy()
            env.update({'PIPELINE_RESULT': 'SUCCESS', 'PIPELINE_SHELL_EXIT_CODE': '0'})
            config = ShellConfig(script=self.data.hooks.cleanup, model=self.model,
                                 env=env, dry_run=self.options.dry_run,
                                 debug=self.options.debug, strict=self.options.strict,
                                 temporary_scripts_path=self.options.temporary_scripts_path)
            cleanup_shell = Bash(config)
            for line in cleanup_shell.process():
                yield line
1129757
def _exec_cleanup(self, cursor, fd):
        
        LOGGER.debug('Closing cursor and cleaning %s', fd)
        try:
            cursor.close()
        except (psycopg2.Error, psycopg2.Warning) as error:
            LOGGER.debug('Error closing the cursor: %s', error)

        self._cleanup_fd(fd)

        # If the cleanup callback exists, remove it
        if self._cleanup_callback:
            self._ioloop.remove_timeout(self._cleanup_callback)

        # Create a new cleanup callback to clean the pool of idle connections
        self._cleanup_callback = self._ioloop.add_timeout(
            self._ioloop.time() + self._pool_idle_ttl + 1,
            self._pool_manager.clean, self.pid)
634058
def post_run(self, outline=False, *args, **kwargs):
        """"""
        post_destroy = self.context.config.post_destroy
        if not outline and post_destroy:
            util.handle_hooks(
                stage="post_destroy",
                hooks=post_destroy,
                provider=self.provider,
                context=self.context)
906802
def _run_hooked_methods(self, hook: str):
        
        for method in self._potentially_hooked_methods:
            for callback_specs in method._hooked:
                if callback_specs['hook'] != hook:
                    continue

                when = callback_specs.get('when')

                if when:
                    if self._check_callback_conditions(callback_specs):
                        method()
                else:
                    method()
133259
@Override
	protected void cleanup() throws MojoExecutionException {
		if (verbose) {
			getLog().info("Clean the rox configuration files");
		}
		
		if (roxActive) {
			// Cleanup the rox configuration files
			useCleanPlugin(
				element("filesets", 
					element("fileset",
						element("directory", getWorkingDirectory().getAbsolutePath()),
						element("followSymlinks", "false"),
						element("includes",
							element("include", ROX_PROPERTIES_FILENAME) // Clean ROX configuration file
						)
					)
				)
			);
		}
	}
252655
def _cleanup(self):
        """"""
        self._expkg = None
        self._extmp = None
        self._flag_e = True
        self._ifile.close()
293401
public void cleanUp() {
        fireProgressEvent(InstallProgressEvent.CLEAN_UP, 98, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CLEANING"));
        if (installAssets != null) {
            for (List<InstallAsset> iaList : installAssets) {
                for (InstallAsset asset : iaList) {
                    asset.delete();
                }
            }
        }
        boolean del = InstallUtils.deleteDirectory(this.product.getInstallTempDir());
        if (!del)
            this.product.getInstallTempDir().deleteOnExit();
        installAssets = null;
        setScriptsPermission = false;
        if (resolveDirector != null)
            resolveDirector.cleanUp();
        if (uninstallDirector != null)
            uninstallDirector.cleanUp();
        log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("MSG_CLEANUP_SUCCESS"));
    }
991592
def cleanup(output_root):
    """"""
    if os.path.exists(output_root):
        if os.path.isdir(output_root):
            rmtree(output_root)
        else:
            os.remove(output_root)
355961
def process_shell(self, creator, entry, config):
        """"""
        self.logger.info("Processing Bash code: start")

        output = []
        shell = creator(entry, config)
        for line in shell.process():
            output.append(line)
            self.logger.info(" | %s", line)

        if shell.success:
            self.logger.info("Processing Bash code: finished")
            return {'success': True, 'output': output}

        for line in self.run_cleanup(config.env, shell.exit_code):
            output.append(line)

        self.logger.error("Pipeline has failed: leaving as soon as possible!")
        self.event.failed()
        return {'success': False, 'output': output}
1227059
def cleanup():
    
    script_dir = os.path.dirname(__file__) if not os.path.islink(__file__) else os.path.dirname(os.readlink(__file__))
    script_dir = os.path.realpath(os.path.join(script_dir, ".."))
    shutil.rmtree(os.path.join(script_dir, "dist"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "tmp"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "urh.egg-info"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "src", "urh.egg-info"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "src", "urh", "tmp"), ignore_errors=True)
257387
static function cleanup()
    {
        $handlers = eZExecution::cleanupHandlers();
        foreach ( $handlers as $handler )
        {
            if ( is_callable( $handler ) )
                call_user_func( $handler );
            else
                eZDebug::writeError('Could not call cleanup handler, is it a static public function?', __METHOD__ );
        }
    }
726937
def call
      extract
      update_config
      check
      setup
      setup_pipeline
      compile
      write_env
      write_init
      setup_crons
      package
      store_cache
    ensure
      teardown if config.clean
    end
970225
function cleanup( $process, $event )
    {
        $theGateway = $this->getCurrentGateway( $event );
        if( $theGateway != null and $theGateway->needCleanup() )
        {
            $theGateway->cleanup( $process, $event );
        }
    }
151913
def cleanup(config=None, path=None):
    """"""
    if config is None:
        config = parse()
    if path is None:
        path = os.getcwd()
    root = config.get('root', 'path')
    root = os.path.join(path, root)
    if sys.path[0] == root:
        sys.path.remove(root)
272467
def run_hook(hook_name, project_dir, context):
    
    script = find_hook(hook_name)
    if script is None:
        logger.debug('No {} hook found'.format(hook_name))
        return
    logger.debug('Running hook {}'.format(hook_name))
    run_script_with_context(script, project_dir, context)
1080741
def cleanup(self):
        """"""
        self.parser = None
        self.request = None
        self.url = None
        self.headers = None
        self._request_handler_task = None
        self._request_stream_task = None
        self._total_request_size = 0
        self._is_stream_handler = False
878257
private void addShutdownHookToCleanUpContainers()
    {
        getLog().info("Started containers will be forcibly cleaned up when the build finishes");
        Runtime.getRuntime().addShutdownHook(new Thread(new Runnable()
        {
            @Override
            public void run()
            {
                cleanUpStartedContainers();
            }
        }));
    }