From 1df10a88cd8b36be8b9b4d47c49dd9e7d1d12bc0 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Mon, 26 Jul 2010 17:54:38 -0400 Subject: Add support for client failover to the ipa command-line. This adds a new global option to the ipa command, -f/--no-fallback. If this is included then just the server configured in /etc/ipa/default.conf is used. Otherwise that is tried first then all servers in DNS with the ldap SRV record are tried. Create a new Local() Command class for local-only commands. The help command is one of these. It shouldn't need a remote connection to execute. ticket #15 --- ipalib/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ipalib/cli.py') diff --git a/ipalib/cli.py b/ipalib/cli.py index 81269cd45..d19e397a0 100644 --- a/ipalib/cli.py +++ b/ipalib/cli.py @@ -572,7 +572,7 @@ class textui(backend.Backend): self.print_line('') return selection -class help(frontend.Command): +class help(frontend.Local): """ Display help for a command or topic. """ @@ -778,12 +778,13 @@ class cli(backend.Executioner): if len(argv) == 0: self.Command.help() return - self.create_context() (key, argv) = (argv[0], argv[1:]) name = from_cli(key) if name not in self.Command or self.Command[name].INTERNAL: raise CommandError(name=key) cmd = self.Command[name] + if not isinstance(cmd, frontend.Local): + self.create_context() kw = self.parse(cmd, argv) if self.env.interactive: self.prompt_interactively(cmd, kw) -- cgit