add build branch
[openstack-build/neutron-build.git] / rpm / SOURCES / openstack-quantum-newdeps.patch
1 --- quantum-2012.2/quantum/__init__.py.orig     2012-09-25 21:44:21.000000000 +0200
2 +++ quantum-2012.2/quantum/__init__.py  2012-10-23 15:11:27.629591625 +0200
3 @@ -15,6 +15,36 @@
4  #    License for the specific language governing permissions and limitations
5  #    under the License.
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