diff options
-rw-r--r-- | ipalib/cli.py | 6 | ||||
-rw-r--r-- | ipalib/errors.py | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py index a0fe63db2..0bab952bf 100644 --- a/ipalib/cli.py +++ b/ipalib/cli.py @@ -443,11 +443,11 @@ class show_api(frontend.Application): else: for name in namespaces: if name not in self.api: - exit_error('api has no such namespace: %s' % name) + raise errors.NoSuchNamespaceError(name) names = namespaces lines = self.__traverse(names) ml = max(len(l[1]) for l in lines) - self.print_name() + self.Backend.textui.print_name('run') first = True for line in lines: if line[0] == 0 and not first: @@ -463,7 +463,7 @@ class show_api(frontend.Application): s = '1 attribute shown.' else: s = '%d attributes show.' % len(lines) - self.print_dashed(s) + self.Backend.textui.print_dashed(s) def __traverse(self, names): diff --git a/ipalib/errors.py b/ipalib/errors.py index d85913042..bc4074d2d 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -117,6 +117,9 @@ class InvocationError(IPAError): class UnknownCommandError(InvocationError): format = 'unknown command "%s"' +class NoSuchNamespaceError(InvocationError): + format = 'api has no such namespace: %s' + def _(text): return text |