Select an authz module using setuptools' entry points mechainsm. bdaf8d72f6eb4fda0ef47e9229dd033deb4a63fa
authorEvan Broder <broder@mit.edu>
Fri, 5 Feb 2010 16:20:58 +0000 (11:20 -0500)
committerEvan Broder <broder@mit.edu>
Fri, 5 Feb 2010 16:20:58 +0000 (11:20 -0500)
Instead of having each authz package install an invirt.authz module,
have them install modules under their own namespace.

In their setup.py, they should indicate that their authz module
provides a unique name within the invirt.authz entry point group.

The new invirt.authz module (part of invirt-base) then gets a name
from the configuration and uses that to find the module.

svn path=/trunk/packages/xvm-authz-locker/; revision=2989

debian/changelog
debian/control
python/xvm/authz/locker.py [moved from python/invirt/authz.py with 100% similarity]
setup.py

index e4ea2a9..0ad4170 100644 (file)
@@ -1,3 +1,10 @@
+xvm-authz-locker (0.0.3) unstable; urgency=low
+
+  * Go back to having an xvm.authz.locker module, but use entry points to
+    find it.
+
+ -- Evan Broder <broder@mit.edu>  Fri, 05 Feb 2010 09:38:05 -0500
+
 xvm-authz-locker (0.0.2) unstable; urgency=low
 
   * Install the authz module as invirt.authz, instead of xvm.authz.locker
index fe71df1..cfe51dc 100644 (file)
@@ -9,8 +9,6 @@ Package: xvm-authz-locker
 Architecture: all
 Depends: ${python:Depends}, ${misc:Depends}, invirt-base, python-afs
 Provides: ${python:Provides}, invirt-authz
-Conflicts: invirt-authz
-Replaces: invirt-authz
 Breaks: invirt-base (<< 0.0.28~)
 XB-Python-Version: ${python:Versions}
 Description: Authorization module for XVM
index 919774f..01fecbb 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -23,6 +23,12 @@ setup(
     maintainer=maintainer,
     maintainer_email=maintainer_email,
     
-    py_modules = ['invirt.authz'],
+    py_modules = ['xvm.authz.locker'],
     package_dir = {'': 'python'},
+
+    entry_points = {
+        'invirt.authz': [
+            'xvm-locker = xvm.authz.locker',
+            ],
+        },
 )