def __find_deployment(jboss_config, salt_source=None):
    result = None
    success = True
    comment = ''
    deployments = __salt__['jboss7.list_deployments'](jboss_config)
    if salt_source is not None and salt_source in 'undeploy' and salt_source['undeploy']:
        deployment_re = re.compile(salt_source['undeploy'])
        for deployment in deployments:
            if deployment_re.match(deployment):
                if result is not None:
                    success = False
                    comment = "More than one deployment matches regular expression: {0}. \n" \
                              "For deployments from Salt file system deployments on JBoss are searched to find one that matches regular expression in 'undeploy' parameter.\n" \
                              "Existing deployments: {1}".format(salt_source['undeploy'], ",".join(deployments))
                else:
                    result = deployment

    return success, result, comment
dataset/ETHPy150Open saltstack/salt/salt/states/jboss7.py/__find_deployment/swapped operands of `in`