diff options
author | Stanislav Laznicka <slaznick@redhat.com> | 2015-08-11 10:10:48 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2015-08-14 11:03:04 +0200 |
commit | 592e437fc79e778cc96603a0f414c3456fcc9455 (patch) | |
tree | 5c0d536b528ff3ce32e555d9668e62b5e70947fb /ipa-client | |
parent | e4dff25838f7a2342779851bd68460080d77683b (diff) | |
download | freeipa-592e437fc79e778cc96603a0f414c3456fcc9455.tar.gz freeipa-592e437fc79e778cc96603a0f414c3456fcc9455.tar.xz freeipa-592e437fc79e778cc96603a0f414c3456fcc9455.zip |
ipa-client-install: warn when IP used in --server
ipa-client-install fails when an IP address is passed
to ipa-join instead of a FQDN
https://fedorahosted.org/freeipa/ticket/4932
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipa-client')
-rwxr-xr-x | ipa-client/ipa-install/ipa-client-install | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index 0b6305f58..e0f53559e 100755 --- a/ipa-client/ipa-install/ipa-client-install +++ b/ipa-client/ipa-install/ipa-client-install @@ -2305,6 +2305,25 @@ def install(options, env, fstore, statestore): root_logger.info("BaseDN: %s", cli_basedn) root_logger.debug("BaseDN source: %s", cli_basedn_source) + # ipa-join would fail with IP address instead of a FQDN + for srv in cli_server: + try: + socket.inet_pton(socket.AF_INET, srv) + is_ipaddr = True + except: + try: + socket.inet_pton(socket.AF_INET6, srv) + is_ipaddr = True + except: + is_ipaddr = False + + if is_ipaddr: + print + root_logger.warning("It seems that you are using an IP address " + "instead of FQDN as an argument to --server. The " + "installation may fail.") + break + print if not options.unattended and not user_input("Continue to configure the system with these values?", False): return CLIENT_INSTALL_ERROR |