~ubuntu-server-dev/nova/havana

« back to all changes in this revision

Viewing changes to debian/patches/fix-boto-versioning.patch

  • Committer: Chuck Short
  • Date: 2014-03-31 17:34:04 UTC
  • Revision ID: zulcss@ubuntu.com-20140331173404-hisiwklaqpsqnucy
debian/patches/fix-boto-versioning.patch: Dropped no longer needed. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Harden version checking for boto
2
 
 Simple string comparison is not effective for version checking.
3
 
 Let's switch to using pkg_resources.parse_version and compare
4
 
 the tuples
5
 
Origin: https://review.openstack.org/#/c/51426/
6
 
Bug: https://bugs.launchpad.net/nova/+bug/1239220
7
 
 
8
 
Index: nova/nova/tests/api/ec2/test_api.py
9
 
===================================================================
10
 
--- nova.orig/nova/tests/api/ec2/test_api.py    2013-12-12 13:18:41.027183269 -0800
11
 
+++ nova/nova/tests/api/ec2/test_api.py 2013-12-12 13:18:41.023183269 -0800
12
 
@@ -18,6 +18,7 @@
13
 
 
14
 
 """Unit tests for the API endpoint."""
15
 
 
16
 
+import pkg_resources
17
 
 import random
18
 
 import re
19
 
 import StringIO
20
 
@@ -272,10 +273,11 @@
21
 
         self.http = FakeHttplibConnection(
22
 
                 self.app, '%s:8773' % (self.host), False)
23
 
         # pylint: disable=E1103
24
 
-        if boto.Version >= '2.14':
25
 
+        boto_version = pkg_resources.parse_version(boto.Version)
26
 
+        if boto_version >= pkg_resources.parse_version('2.13'):
27
 
             self.ec2.new_http_connection(host or self.host, 8773,
28
 
                 is_secure).AndReturn(self.http)
29
 
-        elif boto.Version >= '2':
30
 
+        elif boto_version >= pkg_resources.parse_version('2'):
31
 
             self.ec2.new_http_connection(host or '%s:8773' % (self.host),
32
 
                 is_secure).AndReturn(self.http)
33
 
         else: