def _verify_core_up(deployment_config_dir_path):
    timeout = ctx.bootstrap_context.policy_engine.start_timeout or 30
    ok_path = path.join(deployment_config_dir_path, 'ok')
    end = time.time() + timeout
    while time.time() < end:
        try:
            # after the core is started this file is written as an indication
            with (open(ok_path)):
                pass
            return
        except IOError, e:
            if [errno.ENOENT] in e.errno:
                time.sleep(0.5)
            else:
                raise

    try:
        riemann_log_output = subprocess.check_output(
            'tail -n 100 {}'.format(RIEMANN_LOG_PATH), shell=True)
    except Exception as e:
        riemann_log_output = 'Failed extracting log: {0}'.format(e)

    raise NonRecoverableError('Riemann core has not started in {} seconds.\n'
                              'tail -n 100 {}:\n {}'
                              .format(timeout,
                                      RIEMANN_LOG_PATH,
                                      riemann_log_output))
dataset/ETHPy150Open cloudify-cosmo/cloudify-manager/plugins/riemann-controller/riemann_controller/tasks.py/_verify_core_up/swapped operands of `in`