summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-20 18:07:38 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-20 18:07:38 -0400
commitfd01ae836bab8c11a2608c1703305b7612309dc5 (patch)
treeb248a6a6fc175348ec77873b4272b3919b030084
parent71e0f6916f5cc79a135e87475cca654ad9920247 (diff)
parent925e043108e8b8e6859f07611d206701ae2f7424 (diff)
downloadthird_party-func-fd01ae836bab8c11a2608c1703305b7612309dc5.tar.gz
third_party-func-fd01ae836bab8c11a2608c1703305b7612309dc5.tar.xz
third_party-func-fd01ae836bab8c11a2608c1703305b7612309dc5.zip
Merge branch 'master' of ssh://git.fedoraproject.org/git/hosted/func
-rwxr-xr-xserver/module_loader.py21
-rwxr-xr-xserver/server.py9
2 files changed, 3 insertions, 27 deletions
diff --git a/server/module_loader.py b/server/module_loader.py
index a54c2e9..a18da35 100755
--- a/server/module_loader.py
+++ b/server/module_loader.py
@@ -22,31 +22,18 @@ import glob
from rhpl.translate import _, N_, textdomain, utf8
-def load_modules(module_path=None,
- blacklist=None):
+def load_modules(blacklist=None):
-
-
module_file_path="%s/func/server/modules/" % distutils.sysconfig.get_python_lib()
mod_path="%s/func/server/" % distutils.sysconfig.get_python_lib()
- if module_path is not None:
- module_file_path="%s/modules" % module_path
- mod_path = module_path
-
sys.path.insert(0, mod_path)
mods = {}
-# print sys.path
-# print mod_path
-# print module_file_path
-
filenames = glob.glob("%s/*.py" % module_file_path)
filenames = filenames + glob.glob("%s/*.pyc" % module_file_path)
filesnames = filenames + glob.glob("%s/*.pyo" % module_file_path)
-
-# print "filenames", filenames
for fn in filenames:
basename = os.path.basename(fn)
if basename == "__init__.py":
@@ -58,14 +45,10 @@ def load_modules(module_path=None,
try:
- path = "server.module.%s" % modname
- if module_path is None:
- path = "module.%s" % modname
-
blip = __import__("modules.%s" % ( modname), globals(), locals(), [modname])
if not hasattr(blip, "register_rpc"):
errmsg = _("%(module_path)s/%(modname)s module not a proper module")
- print errmsg % {'module_path': module_path, 'modname':modname}
+ print errmsg % {'module_path': module_file_path, 'modname':modname}
continue
mods[modname] = blip
except ImportError, e:
diff --git a/server/server.py b/server/server.py
index 7b0a1a2..f7370b8 100755
--- a/server/server.py
+++ b/server/server.py
@@ -166,8 +166,6 @@ def main(argv):
"""
- module_path=None
-
for arg in sys.argv:
if arg == "import" or arg == "--import":
prov_obj = provisioning.Provisioning()
@@ -177,13 +175,8 @@ def main(argv):
prov_obj = provisioning.Provisioning()
prov_obj.sync(None, {}) # just for testing
return
- elif arg in ["debug", "--debug", "-d"]:
- # basically, run from the src tree instead of
- # using the installed modules
- module_path="modules/"
- mod_path="server/"
- modules = module_loader.load_modules(module_path=module_path)
+ modules = module_loader.load_modules()
print "modules", modules