gholt / swauth

This is the historical location of Swauth; active development is now at https://github.com/openstack/swauth
45 stars 30 forks source link

swauth cannot handle version parsing of redhat swift versions #66

Closed alanmeadows closed 10 years ago

alanmeadows commented 10 years ago

Redhat applies package/patch versions to the redhat python module as well as EL release number.

The version parsing in swauth implodes when trying to convert some parts of this string to an integer.

For example, on CentOS 6.4:

python -c 'import swift; print swift.version;'

1.10.0-2.el6

gholt commented 10 years ago

Seems likely. Looks like Swauth just needs to know the if the Swift version is >1.7.7-dev as that is when a backwards incompatible change happened with Swift's memcache client. I'd be happy to accept a patch to swift_version that supported your versioning or a replacement way of determining this code branch.

alanmeadows commented 10 years ago

Happy to provide a pull request shortly. I sometimes lag between my issue reporting and my pull requests.

gholt commented 10 years ago

Haha, no problem. I'm on Benadryl so I'm lucky I can type a thing.

jordannielsen commented 10 years ago

Do you guys know when this will be fixed or is there is a current workaround? Thanks!

cbartz commented 10 years ago

@jordannielsen : You can hardcode the version number. Replace line 30 of swift_version.py by

MAJOR, MINOR, REVISION, FINAL = parse('1.12.0')

if your version number equals 1.12.0 .

jordannielsen commented 10 years ago

Thanks! We just switched to swauth and have been stuck on grizzly because of this bug. Much appreciated!

Sent from my iPhone

On Mar 26, 2014, at 4:17 AM, "rothose" notifications@github.com<mailto:notifications@github.com> wrote:

@jordannielsenhttps://github.com/jordannielsen : You can hardcode the version number. Replace line 30 of swift_version.py by

MAJOR, MINOR, REVISION, FINAL = parse('1.12.0')

if your version number equals 1.12.0 .

— Reply to this email directly or view it on GitHubhttps://github.com/gholt/swauth/issues/66#issuecomment-38667389.

gholt commented 10 years ago

That should work. I'm not sure how all the distros decide on their versioning they assign to Swift. For that matter, the source versioning for Swift has changed over time too. :( Right now on Swift's master it happens to use '1.13.0.62.gd4a1d75' which Swauth parses fine.

jordannielsen commented 10 years ago

I modified the swift_version.py as you suggested and reinstalled swauth and that worked. Thanks a ton!

Fuzi0n commented 10 years ago

That fixed worked for me too.

In order to prevent others users to struggle with that issue, I copy/paste my swift-init's output:

File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load entry = import(self.module_name, globals(),globals(), ['name']) File "/usr/lib/python2.6/site-packages/swauth-1.0.9.dev-py2.6.egg/swauth/middleware.py", line 46, in MEMCACHE_TIME = swift_version.newer_than('1.7.7-dev') File "/usr/lib/python2.6/site-packages/swauth-1.0.9.dev-py2.6.egg/swauth/swift_version.py", line 30, in newer_than MAJOR, MINOR, REVISION, FINAL = parse(swift.version) File "/usr/lib/python2.6/site-packages/swauth-1.0.9.dev-py2.6.egg/swauth/swift_version.py", line 20, in parse revision = int(parts.pop(0)) ValueError: invalid literal for int() with base 10: '1-1'

gholt commented 10 years ago

Doesn't look like @alanmeadows got time to try a pull request, so I've just done what I can to defensively code for this and any other weird things packagers decide to do. ;)

jordannielsen commented 9 years ago

Thanks gholt! Appreciate all the help! We are using swauth for our OpenStack Swift archives cluster and it works great! Will you or others continue working on swauth system as Swift updates and features come out?