(self, ip)
Configure the potential hostnames associated with the container.
Configure the potential hostnames associated with the container.
Configure the potential hostnames associated with the container .
def _setup_hostnames(self, ip):
        """ Configure the potential hostnames associated with the container. """
        hostnames = self.options.get('hostnames', [])
        if not hostnames:
            return

        etchosts = EtcHosts()
        for hostname in hostnames:
            logger.info('Setting {hostname} to point to {ip}.'.format(
                hostname=hostname, ip=ip))
            etchosts.ensure_binding_present(hostname, ip)
        if etchosts.changed:
            logger.info("Saving host bindings to /etc/hosts. sudo may be needed")
            etchosts.save()
def _setup_hostnames ( self , ip ) : hostnames = self . options . get ( 'hostnames' , [ ] ) if not hostnames : return etchosts = EtcHosts ( ) for hostname in hostnames : logger . info ( 'Setting {hostname} to point to {ip}.' . format ( hostname = hostname , ip = ip ) ) etchosts . ensure_binding_present ( hostname , ip ) if etchosts . changed : logger . info ( "Saving host bindings to /etc/hosts. sudo may be needed" ) etchosts . save ( )