diff options
| author | Adrian Likins <alikins@redhat.com> | 2007-09-20 17:57:52 -0400 |
|---|---|---|
| committer | Adrian Likins <alikins@redhat.com> | 2007-09-20 17:57:52 -0400 |
| commit | a847a423257a863c18f20b003820f74dcd5259af (patch) | |
| tree | 3a49b6666dbfac23c7865c81365a7a1fc474433f /server | |
| parent | 50250e45f0c225198e08097a525cc5ff1b91474d (diff) | |
remove all the --debug "try to run from the src tree" crap
3rd party modules wont be here anyway, so remove all that
weird noise
Diffstat (limited to 'server')
| -rwxr-xr-x | server/module_loader.py | 21 | ||||
| -rwxr-xr-x | server/server.py | 9 |
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 |
