boto version checking in test cases still not correct

Bug #1239890 reported by Adam Gandelman
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Stanislaw Pitucha

Bug Description

https://review.openstack.org/#/c/50908/ was meant to fix test cases to inspect boto versions and use the correct function parameters accordinglyin api tests.

boto_version = pkg_resources.parse_version(boto.Version)
if boto_version >= (2, 13):
    self.ec2.new_http_connection(host or self.host, 8773,
        is_secure).AndReturn(self.http)
elif boto_version >= (2,):
    self.ec2.new_http_connection(host or '%s:8773' % (self.host),
        is_secure).AndReturn(self.http)
else:
    self.ec2.new_http_connection(host, is_secure).AndReturn(self.http)

However, this is still not correct:

>>> import pkg_resources
>>> import boto
>>> print boto.Version
2.9.6
>>> boto_version = pkg_resources.parse_version(boto.Version)
>>> print boto_version
('00000002', '00000009', '00000006', '*final')
>>> print boto_version >= (2, 13)

I believe we should also be using pkg_resources to construct the other side of the conditional:

>>> print boto_version >= pkg_resources.parse_version('2.13')
False

tags: added: grizzly-backport-potential havana-backport-potential
tags: removed: grizzly-backport-potential havana-backport-potential
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :
Changed in nova:
assignee: nobody → Adam Gandelman (gandelman-a)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Chris Behrens (cbehrens) wrote :

I don't think 2.13 actually has this arg. It seems like the check needs to be >= '2.14' or something. Or > '2.13.3' at least.

This is our version that does not have the new port arg:

('00000002', '00000013', '00000003', '*final')

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/53538
Committed: http://github.com/openstack/nova/commit/17585b26470c510a2a3098898d8b7de8dc527fb1
Submitter: Jenkins
Branch: master

commit 17585b26470c510a2a3098898d8b7de8dc527fb1
Author: Stanislaw Pitucha <email address hidden>
Date: Thu Oct 24 09:31:33 2013 +0100

    Fix the boto version comparison

    Use versionutils to check the boto version in parsed form rather than
    comparing text.

    Fixes bug: 1239890

    Change-Id: Iea421ab0d86ce29648a8b8f757456364ea21e956

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Alan Pevec (apevec)
Changed in nova:
assignee: Adam Gandelman (gandelman-a) → Stanislaw Pitucha (stanislaw-pitucha)
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.