Update spec 2013.1.3
[openstack-build/cinder-build.git] / rpm / SOURCES / openstack-cinder-newdeps.patch
1 --- cinder-2013.1-orig/cinder/__init__.py       2012-11-22 04:22:19.000000000 -0500
2 +++ cinder-2013.1/cinder/__init__.py    2012-12-20 12:57:42.337489999 -0500
3 @@ -31,6 +31,36 @@
4  .. moduleauthor:: Andy Smith <andy@anarkystic.com>
5  """
6  
7 +import sys
8 +import pkg_resources
9 +
10 +# If there is a conflicting non egg module,
11 +# i.e. an older standard system module installed,
12 +# then replace it with this requirement
13 +def replace_dist(requirement):
14 +    try:
15 +        return pkg_resources.require(requirement)
16 +    except pkg_resources.VersionConflict:
17 +        e = sys.exc_info()[1]
18 +        dist=e.args[0]
19 +        req=e.args[1]
20 +        if dist.key == req.key and not dist.location.endswith('.egg'):
21 +            del pkg_resources.working_set.by_key[dist.key]
22 +            # We assume there is no need to adjust sys.path
23 +            # and the associated pkg_resources.working_set.entries
24 +            return pkg_resources.require(requirement)
25 +
26 +replace_dist("WebOb >= 1.0")
27 +replace_dist("SQLAlchemy >= 0.6.3")
28 +replace_dist("Routes >= 1.12.3")
29 +
30 +replace_dist("PasteDeploy >= 1.5.0")
31 +# This hack is needed because replace_dist() results in
32 +# the standard paste module path being at the start of __path__.
33 +# TODO: See can we get pkg_resources to do the right thing directly
34 +import paste
35 +paste.__path__.insert(0, paste.__path__.pop(-1))
36 +
37  import gettext
38  
39  
40 --- cinder-2013.1-orig/bin/cinder-manage        2012-11-22 04:22:19.000000000 -0500
41 +++ cinder-2013.1/bin/cinder-manage     2012-12-20 12:58:01.014504835 -0500
42 @@ -60,9 +60,6 @@
43  import sys
44  import uuid
45  
46 -from sqlalchemy import create_engine, MetaData, Table
47 -from sqlalchemy.ext.declarative import declarative_base
48 -from sqlalchemy.orm import sessionmaker
49  
50  
51  # If ../cinder/__init__.py exists, add ../ to Python search path, so that
52 @@ -86,6 +83,10 @@
53  from cinder import utils
54  from cinder import version
55  
56 +from sqlalchemy import create_engine, MetaData, Table
57 +from sqlalchemy.orm import sessionmaker
58 +from sqlalchemy.ext.declarative import declarative_base
59 +
60  FLAGS = flags.FLAGS
61  
62  
63 --- cinder-2013.1-orig/cinder/db/sqlalchemy/migration.py        2012-11-22 04:22:19.000000000 -0500
64 +++ cinder-2013.1/cinder/db/sqlalchemy/migration.py     2012-12-20 12:57:44.821491814 -0500
65 @@ -57,7 +57,12 @@
66  
67  
68  # NOTE(jkoelker) Delay importing migrate until we are patched
69 -from migrate import exceptions as versioning_exceptions
70 +try:
71 +    # Try the more specific path first (migrate <= 0.6)
72 +    from migrate.versioning import exceptions as versioning_exceptions
73 +except ImportError:
74 +    # Use the newer path (migrate >= 0.7)
75 +    from migrate import exceptions as versioning_exceptions
76  from migrate.versioning import api as versioning_api
77  from migrate.versioning.repository import Repository
78