Skip to content

Commit

Permalink
more specific warning
Browse files Browse the repository at this point in the history
  • Loading branch information
revol.cai committed May 25, 2018
1 parent 56e29b4 commit 9ae908e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions etcd3/baseclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,18 @@ def _retrieve_version(self): # pragma: no cover
r.raise_for_status()
v = r.json()
self.cluster_version = v["etcdcluster"]
if sem.Version(self.cluster_version) < sem.Version('3.2.2'):
warnings.warn(Etcd3Warning("detected etcd cluster version(%s) is lower than 3.2.2, "
"the gRPC-JSON-Gateway may not work" % self.cluster_version))
if sem.Version(self.cluster_version) < sem.Version('3.3.0'):
warnings.warn(Etcd3Warning("detected etcd cluster version(%s) is lower than 3.3.0, "
"the gRPC-JSON-Gateway may not work" % self.cluster_version))
"authentication methods may not work" % self.cluster_version))
else:
self.api_prefix = '/v3'
except Exception:
warnings.warn(Etcd3Warning("cannot detect etcd server version\n"
"1. maybe is a network problem, please check your network connection\n"
"2. maybe your etcd server version is too low, required: 3.3.0+"))
"2. maybe your etcd server version is too low, required: 3.2.2+"))

@property
def baseurl(self):
Expand Down

0 comments on commit 9ae908e

Please sign in to comment.