(self)
Updates /etc/hosts on **all** running lxdock-managed containers.

        ... even those outside the current project. This way, containers can contact themselves
        using the same domain names the host uses.
Updates /etc/hosts on **all** running lxdock-managed containers.
Updates / etc / hosts on ** all ** running lxdock - managed containers .
def _update_guest_etchosts(self):
        """ Updates /etc/hosts on **all** running lxdock-managed containers.

        ... even those outside the current project. This way, containers can contact themselves
        using the same domain names the host uses.
        """
        def should_update(c):
            return c.config.get('user.lxdock.made') and c.status_code == constants.CONTAINER_RUNNING
        # At this point, our host's /etc/hosts is fully updated. No need to go fetch IP's and stuff
        # we can just re-use what we've already computed in every container up/halt ops before.
        etchosts = EtcHosts()
        containers = (c for c in self.client.containers.all() if should_update(c))
        for container in containers:
            container_etchosts = ContainerEtcHosts(container)
            container_etchosts.lxdock_bindings = etchosts.lxdock_bindings
            container_etchosts.save()
def _update_guest_etchosts ( self ) : def should_update ( c ) : return c . config . get ( 'user.lxdock.made' ) and c . status_code == constants . CONTAINER_RUNNING # At this point, our host's /etc/hosts is fully updated. No need to go fetch IP's and stuff # we can just re-use what we've already computed in every container up/halt ops before. etchosts = EtcHosts ( ) containers = ( c for c in self . client . containers . all ( ) if should_update ( c ) ) for container in containers : container_etchosts = ContainerEtcHosts ( container ) container_etchosts . lxdock_bindings = etchosts . lxdock_bindings container_etchosts . save ( )