From 64fa3dd4c3a03e7a677453c9150f84ffc4e91c7a Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Mon, 20 Apr 2009 13:58:26 -0400 Subject: Finish work replacing the errors module with errors2 Once this is committed we can start the process of renaming errors2 as errors. I thought that combinig this into one commit would be more difficult to review. --- ipalib/cli.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'ipalib/cli.py') diff --git a/ipalib/cli.py b/ipalib/cli.py index 11b56e36..36c945f2 100644 --- a/ipalib/cli.py +++ b/ipalib/cli.py @@ -36,8 +36,7 @@ import frontend import backend import plugable import util -from errors2 import PublicError, CommandError, HelpError, InternalError -import errors +from errors2 import PublicError, CommandError, HelpError, InternalError, NoSuchNamespaceError, ValidationError from constants import CLI_TAB from parameters import Password, Bytes from request import ugettext as _ @@ -456,7 +455,7 @@ class show_api(frontend.Application): else: for name in namespaces: if name not in self.api: - raise errors.NoSuchNamespaceError(name) + raise NoSuchNamespaceError(name=name) names = namespaces lines = self.__traverse(names) ml = max(len(l[1]) for l in lines) @@ -478,7 +477,6 @@ class show_api(frontend.Application): s = '%d attributes show.' % len(lines) self.Backend.textui.print_dashed(s) - def __traverse(self, names): lines = [] for name in names: @@ -635,7 +633,7 @@ class cli(backend.Executioner): if value is not None: kw[param.name] = value break - except errors.ValidationError, e: + except ValidationError, e: error = e.error -- cgit