diff options
author | Rob Crittenden <rcritten@redhat.com> | 2010-07-26 17:54:38 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2010-08-16 10:35:27 -0400 |
commit | 1df10a88cd8b36be8b9b4d47c49dd9e7d1d12bc0 (patch) | |
tree | 965da3c4c157e0aaba6b876b578ebcf8a7dc190d /ipalib/plugable.py | |
parent | 3e6f0f5721f76977475792f09758f6b8dcc4ed4e (diff) | |
download | freeipa-1df10a88cd8b36be8b9b4d47c49dd9e7d1d12bc0.tar.gz freeipa-1df10a88cd8b36be8b9b4d47c49dd9e7d1d12bc0.tar.xz freeipa-1df10a88cd8b36be8b9b4d47c49dd9e7d1d12bc0.zip |
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
Diffstat (limited to 'ipalib/plugable.py')
-rw-r--r-- | ipalib/plugable.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py index fd5f31a76..cb87ebeab 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -455,6 +455,10 @@ class API(DictProxy): dest='interactive', help='Prompt for NO values (even if required)' ) + parser.add_option('-f', '--no-fallback', action='store_false', + dest='fallback', + help='Only use the server configured in /etc/ipa/default.conf' + ) topics = optparse.OptionGroup(parser, "Available help topics", "ipa help topics") cmds = optparse.OptionGroup(parser, "Available commands", @@ -479,7 +483,8 @@ class API(DictProxy): # --Jason, 2008-10-31 pass overrides[str(key.strip())] = value.strip() - for key in ('conf', 'debug', 'verbose', 'prompt_all', 'interactive'): + for key in ('conf', 'debug', 'verbose', 'prompt_all', 'interactive', + 'fallback'): value = getattr(options, key, None) if value is not None: overrides[key] = value |