jplana / python-etcd

A python client for etcd
Other
522 stars 210 forks source link

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

Closed besnardjb closed 1 year ago

besnardjb commented 7 years ago

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.

coveralls commented 7 years ago

Coverage Status

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