diff --git a/pykolab/cli/commands.py b/pykolab/cli/commands.py --- a/pykolab/cli/commands.py +++ b/pykolab/cli/commands.py @@ -44,7 +44,7 @@ cmd_name = module_name.replace('cmd_', '') #print "exec(\"from %s import __init__ as %s_register\"" % (module_name,cmd_name) try: - exec("from %s import __init__ as %s_register" % (module_name,cmd_name)) + exec("from .%s import __init__ as %s_register" % (module_name,cmd_name)) except ImportError: pass @@ -121,7 +121,7 @@ group = commands[cmd_name]['group'] command_name = commands[cmd_name]['cmd_name'] try: - exec("from %s.cmd_%s import cli_options as %s_%s_cli_options" % (group,command_name,group,command_name)) + exec("from .%s.cmd_%s import cli_options as %s_%s_cli_options" % (group,command_name,group,command_name)) exec("%s_%s_cli_options()" % (group,command_name)) except ImportError: pass @@ -151,7 +151,7 @@ module_name = filename.replace('.py','') cmd_name = module_name.replace('cmd_', '') #print "exec(\"from %s.%s import __init__ as %s_%s_register\"" % (module,module_name,module,cmd_name) - exec("from %s.%s import __init__ as %s_%s_register" % (module,module_name,module,cmd_name)) + exec("from .%s.%s import __init__ as %s_%s_register" % (module,module_name,module,cmd_name)) exec("%s_%s_register()" % (module,cmd_name)) def register(cmd_name, func, group=None, description=None, aliases=[]):