Пример #1
0
    def crawl(self, container_id, avoid_setns=False, **kwargs):
        inspect = utils.dockerutils.exec_dockerinspect(container_id)
        state = inspect['State']
        pid = str(state['Pid'])
        logger.debug('Crawling OS for container %s' % container_id)

        if avoid_setns:
            mp = utils.dockerutils.get_docker_container_rootfs_path(
                container_id)
            return crawl_os_mountpoint(mp)
        else:  # in all other cases, including wrong mode set
            return run_as_another_namespace(pid, ALL_NAMESPACES, crawl_os)
    def crawl(self, container_id, avoid_setns=False, **kwargs):
        inspect = utils.dockerutils.exec_dockerinspect(container_id)
        state = inspect['State']
        pid = str(state['Pid'])
        logger.debug('Crawling OS for container %s' % container_id)

        if avoid_setns:
            mp = utils.dockerutils.get_docker_container_rootfs_path(
                container_id)
            return crawl_os_mountpoint(mp)
        else:  # in all other cases, including wrong mode set
            return run_as_another_namespace(pid,
                                            ALL_NAMESPACES,
                                            crawl_os)
Пример #3
0
 def crawl(self, root_dir='/', **kwargs):
     if root_dir == '/':
         return crawl_os()
     else:
         return crawl_os_mountpoint(root_dir)