def _check_device(device, config):
    '''
    Check if device is present
    '''
    if device not in '/' and config['device_dir'] and os.path.exists(config['device_dir']):
        device = os.path.join(config['device_dir'], device)

    if not os.path.exists(device):
        return False, 'not present on filesystem'
    else:
        mode = os.stat(device).st_mode
        if not stat.S_ISBLK(mode) and not stat.S_ISREG(mode) and not stat.S_ISCHR(mode):
            return False, 'not a block device, a file vdev or character special device'

    return True, ''
dataset/ETHPy150Open saltstack/salt/salt/states/zpool.py/_check_device/swapped operands of `not in`