diff options
author | Martin Basti <mbasti@redhat.com> | 2016-09-12 14:38:12 +0200 |
---|---|---|
committer | David Kupka <dkupka@redhat.com> | 2016-09-14 15:30:55 +0200 |
commit | 1c96ff7a6c7e1733a6492f9b3c93265f5bc8ff5b (patch) | |
tree | 685ead7e0d0e8ffa9c0167e5d10bd514326d86d4 /client/ipa-client-install | |
parent | 271a4f098230112ee0e3ea3ffb3a509977ee7330 (diff) | |
download | freeipa-1c96ff7a6c7e1733a6492f9b3c93265f5bc8ff5b.tar.gz freeipa-1c96ff7a6c7e1733a6492f9b3c93265f5bc8ff5b.tar.xz freeipa-1c96ff7a6c7e1733a6492f9b3c93265f5bc8ff5b.zip |
Abstract procedures for IP address warnings
Originaly there should be only two occurencees of this warning, one for
server, one for client. But obviously is not possible with current
installers to achive this goal, so I have to extract code to not mess
with 5 times copy and paste.
https://fedorahosted.org/freeipa/ticket/5814
Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'client/ipa-client-install')
-rwxr-xr-x | client/ipa-client-install | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/client/ipa-client-install b/client/ipa-client-install index 6330f1d28..535fe65da 100755 --- a/client/ipa-client-install +++ b/client/ipa-client-install @@ -55,7 +55,9 @@ try: from ipalib import api, errors from ipalib import x509, certstore from ipalib.util import ( - normalize_hostname, validate_domain_name, verify_host_resolvable) + normalize_hostname, validate_domain_name, verify_host_resolvable, + network_ip_address_warning, broadcast_ip_address_warning + ) from ipalib.constants import CACERT from ipapython.dn import DN from ipapython.ssh import SSHPublicKey @@ -1651,19 +1653,8 @@ def update_dns(server, hostname, options): root_logger.info("Failed to determine this machine's ip address(es).") return - for ip in update_ips: - if ip.is_network_addr(): - root_logger.warning("IP address %s might be network address", ip) - # fixme: once when loggers will be fixed, we can remove this print - print( - "WARNING: IP address {} might be network address".format(ip), - file=sys.stderr) - if ip.is_broadcast_addr(): - root_logger.warning("IP address %s might be broadcast address", ip) - # fixme: once when loggers will be fixed, we can remove this print - print( - "WARNING: IP address {} might be broadcast address".format(ip), - file=sys.stderr) + network_ip_address_warning(update_ips) + broadcast_ip_address_warning(update_ips) update_txt = "debug\n" update_txt += ipautil.template_str(DELETE_TEMPLATE_A, |