VMM/cli/main: Adjusted _get_handler() to changes in config module. v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Mon, 09 Aug 2010 03:52:01 +0000
branchv0.6.x
changeset 354 a653c43048b1
parent 353 2ae40cd0d213
child 355 48bf20b43f2e
VMM/cli/main: Adjusted _get_handler() to changes in config module.
VirtualMailManager/cli/main.py
--- a/VirtualMailManager/cli/main.py	Mon Aug 09 03:48:28 2010 +0000
+++ b/VirtualMailManager/cli/main.py	Mon Aug 09 03:52:01 2010 +0000
@@ -14,9 +14,8 @@
 from VirtualMailManager.config import BadOptionError, ConfigValueError
 from VirtualMailManager.cli import w_err
 from VirtualMailManager.cli.handler import CliHandler
-from VirtualMailManager.constants import CONF_ERROR, DATABASE_ERROR, \
-     EX_MISSING_ARGS, EX_SUCCESS, EX_UNKNOWN_COMMAND, EX_USER_INTERRUPT, \
-     INVALID_ARGUMENT
+from VirtualMailManager.constants import DATABASE_ERROR, EX_MISSING_ARGS, \
+     EX_SUCCESS, EX_UNKNOWN_COMMAND, EX_USER_INTERRUPT, INVALID_ARGUMENT
 from VirtualMailManager.cli.subcommands import RunContext, cmd_map, usage
 
 
@@ -27,13 +26,11 @@
     """Try to get a CliHandler. Exit the program when an error occurs."""
     try:
         handler = CliHandler()
-        handler.cfg_install()
     except (errors.NotRootError, errors.PermissionError, errors.VMMError,
             errors.ConfigError), err:
         w_err(err.code, _(u'Error: %s') % err.msg)
-    except ConfigValueError, err:
-        w_err(CONF_ERROR, _(u'Error: %s') % err)
     else:
+        handler.cfg_install()
         return handler