def log_atime_config(path, crawlmode):
    atime_config = 'unknown'
    mountlocation = find_mount_point(path=path)
    logger.info('Mount location for specified crawl root_dir %s: %s'
                % (path, mountlocation))

    # Looking at `mount` for atime config is only meaningful for INVM

    if crawlmode == 'INVM':
        grepstr = mountlocation % 'on %s '
        try:
            mount = subprocess.Popen('mount', stdout=subprocess.PIPE,
                                     stderr=subprocess.PIPE)
            mountlist = subprocess.Popen(
                ('grep',
                 grepstr),
                stdin=mount.stdout,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE)
            mountlist_arr = mountlist.stdout.read().split('\n')
            if len(mountlist_arr) > 0:

                # pick the first one if we found more than one mount location
                # Will look like: "/dev/xvda2 on / type ext3
                # (rw,noatime,errors=remount-ro,barrier=0)"

                ptrn = r'.*?\((.*?)\).*?'
                match = re.search(ptrn, mountlist_arr[0])

                # Get the part in parenthesis and split. WIll look like:
                # "rw,noatime,errors=remount-ro,barrier=0"

                for i in match.group(1).split(','):
                    if i.strip() == 'noatime':
                        atime_config = 'noatime'
                        logger.debug(
                            'Found atime config: %s in mount information, '
                            'updating log' % atime_config)
                        break
                    elif i.strip() == 'relatime':
                        atime_config = 'relatime'
                        logger.debug(
                            'Found atime config: %s in mount information, '
                            'updating log' % atime_config)
                        break
                    elif i.strip() == 'strictatime':
                        atime_config = 'strictatime'
                        logger.debug(
                            'Found atime config: %s in mount information, '
                            'updating log' % atime_config)
                        break

                # If we found a mount location, but did not have atime info in
                # mount. Assume it is the default relatime. As it does not show
                # in mount options by default.

                if atime_config == 'unknown':
                    atime_config = 'relatime'
                    logger.debug(
                        'Did not find any atime config for the matching mount '
                        'location. Assuming: %s' % atime_config)
        except OSError as e:
            logger.error('Failed to query mount information: ' +
                         '[Errno: %d] ' % e.errno + e.strerror +
                         ' [Exception: ' + type(e).__name__ + ']')

    logger.info("Atime configuration for '%s': '%s'" % (mountlocation,
                                                        atime_config))
    if atime_config == 'strictatime':
        logger.info('strictatime: File access times are reflected correctly'
                    )
    if atime_config == 'relatime':
        logger.info(
            'relatime: File access times are only updated after 24 hours')
    if atime_config == 'noatime':
        logger.info('noatime: File access times are never updated properly'
                    )
    if atime_config == 'unknown':
        logger.info(
            'unknown: Could not determine atime config. File atime '
            'information might not be reliable')
    return atime_config
dataset/ETHPy150Open cloudviz/agentless-system-crawler/crawler/misc.py/log_atime_config/swapped operands of `%`