def METHOD_NAME(self, deployer):
    if config.str2bool(deployer.mdict['pki_skip_installation']):
        logger.info('Skipping SELinux setup')
        return
    if not selinux.is_selinux_enabled() or seobject is None:
        logger.info('SELinux disabled')
        return
    instance = self.instance
    logger.info('Creating SELinux contexts')
    # A maximum of 10 tries to create the SELinux contexts
    counter = 0
    max_tries = 10
    while True:
        try:
            # check first if any transactions are required
            if len(ports) == 0 and deployer.mdict['pki_instance_name'] == \
                    config.PKI_DEPLOYMENT_DEFAULT_TOMCAT_INSTANCE_NAME:
                deployer.restore_selinux_contexts()
                return
            # add SELinux contexts when adding the first subsystem
            if len(instance.get_subsystems()) == 1:
                if deployer.mdict['pki_instance_name'] != \
                        config.PKI_DEPLOYMENT_DEFAULT_TOMCAT_INSTANCE_NAME:
                    deployer.create_selinux_contexts()
                deployer.restore_selinux_contexts()
            break
        except ValueError as e:
            error_message = str(e)
            logger.error(error_message)
            if error_message.strip() == \
                    "Could not start semanage transaction":
                counter += 1
                if counter >= max_tries:
                    raise
                time.sleep(5)
                logger.debug("Retrying to setup the selinux context ...")
            else:
                raise