python-etcd icon indicating copy to clipboard operation
python-etcd copied to clipboard

AUTH : Fix version check to avoid crashing on API detection through v…

Open besnardjb opened this issue 8 years ago • 1 comments

Dear Maintainer,

I've ecountered an error using the GIT version of Etcd, you get versions such as "3.2.0-rc.1+git"

Previous code led to this error:

"/usr/lib/python2.7/site-packages/etcd/auth.py", line 25, in legacy_api
major, minor, _ = map(int, self.client.version.split('.'))
ValueError: invalid literal for int() with base 10: '0-rc'

This proposes a (very) simple fix by only keeping the beginning of the version string.

Regards,

Jean-Baptiste.

besnardjb avatar Jul 10 '17 20:07 besnardjb

Coverage Status

Coverage remained the same at 88.071% when pulling 30650f6c98b8abd508a8d12d7df7fc3633c8c454 on besnardjb:master into b227f496c038b2b856c4d76c9525b3547e5c8dc4 on jplana:master.

coveralls avatar Jul 10 '17 20:07 coveralls