__init__.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:dcos-e2e 作者: mesosphere 项目源码 文件源码
def _nodes(self, container_base_name: str) -> Set[Node]:
        """
        Args:
            container_base_name: The start of the container names.

        Returns: ``Node``s corresponding to containers with names starting
            with ``container_base_name``.
        """
        client = docker.from_env(version='auto')
        filters = {'name': container_base_name}
        containers = client.containers.list(filters=filters)

        return set(
            Node(
                ip_address=IPv4Address(
                    container.attrs['NetworkSettings']['IPAddress']
                ),
                ssh_key_path=self._path / 'include' / 'ssh' / 'id_rsa',
            ) for container in containers
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号