]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fixes Windows setup dependency bug
authoralexpilotti <ap@pilotti.it>
Thu, 15 Aug 2013 16:49:31 +0000 (19:49 +0300)
committeralexpilotti <ap@pilotti.it>
Thu, 15 Aug 2013 19:58:14 +0000 (22:58 +0300)
Fixes bug: #1212385

The neutron project includes a setup hook that allows to dinamically
include setup dependencies.

Due to recent changes in the pbr project, the hook raises an exception
on Windows, which ends the setup process.

This fix solves the issue by adapting the hook to the recent pbr changes.

Change-Id: I4b00d74d23a7167a10ba86458943ff16ca51b0db

neutron/hooks.py
requirements.txt

index 2c6a587a6d593503d2bbf9fee3977197c254c5db..6b4a1e78c6b9d2653e9758d065778c7aa8a05dec 100644 (file)
@@ -21,10 +21,11 @@ import sys
 def setup_hook(config):
     """Filter config parsed from a setup.cfg to inject our defaults."""
     metadata = config['metadata']
+    requires = metadata.get('requires_dist', '').split('\n')
     if sys.platform == 'win32':
-        requires = metadata.get('requires_dist', list()).split('\n')
         requires.append('pywin32')
         requires.append('wmi')
-        requires.remove('pyudev')
-        metadata['requires_dist'] = "\n".join(requires)
+    elif sys.platform.startswith('linux'):
+        requires.append('pyudev')
+    metadata['requires_dist'] = "\n".join(requires)
     config['metadata'] = metadata
index 21af5e499a90243962289dab8b52e48246cff0f5..828d4d5b8de88ae7f7b7fb6e0c73d0f69d85e801 100644 (file)
@@ -14,7 +14,6 @@ iso8601>=0.1.4
 kombu>=2.4.8
 netaddr
 python-neutronclient>=2.2.3,<3
-pyudev
 SQLAlchemy>=0.7.8,<=0.7.99
 WebOb>=1.2.3,<1.3
 python-keystoneclient>=0.3.0