def METHOD_NAME(self, reset=False):
    if self.client and reset is False:
        return self.client  # Use cached client
    if self.settings.get('port') is not -1:
        try_ports = [self.settings.get('port')]
    else:
        try_ports = DEFAULT_ETCD_PORTS
    for port in try_ports:
        try:
            self.client = etcd_client(
                host=self.settings.get('host'),
                port=port,
                username=self.settings.get('username'),
                password=self.settings.get('password'),
                allow_reconnect=self.settings.get('allow_reconnect'),
                protocol=self.settings.get('protocol'),
            )
            return self.client
        except EtcdConnectionFailed as e:
            log.debug("Can't connect to etcd on %s://%s:%d: %s" %
                      (self.settings.get('protocol'), self.settings.get('host'), port, str(e)))
    # No port succeeded, raise an exception
    if self.settings.get('port') is not -1:
        raise ValueError("Can't connect to etcd on %s://%s:%d" %
                         (self.settings.get('protocol'),
                          self.settings.get('host'),
                          self.settings.get('port')))
    else:
        raise ValueError("Can't connect to etcd host on %s://%s on default ports 4001 and 2379" %
                         (self.settings.get('protocol'),
                          self.settings.get('host')))