Blob Blame History Raw
From 52be5b4d693febdc1fa1fe9d54b1d052a09c347f Mon Sep 17 00:00:00 2001
From: Martin Basti <mbasti@redhat.com>
Date: Thu, 15 Jun 2017 10:27:55 +0200
Subject: [PATCH] Remove network and broadcast address warnings

We cannot reliably determine when an IP Address is network or broadcast.
We allowed to use non-local IP addresses due container use cases, we
don't know subnets of used IP addresses.

https://pagure.io/freeipa/issue/4317

Reviewed-By: David Kupka <dkupka@redhat.com>
---
 ipaclient/install/client.py                |  4 ----
 ipalib/util.py                             | 20 --------------------
 ipaserver/install/dns.py                   |  2 --
 ipaserver/install/server/install.py        |  4 ----
 ipaserver/install/server/replicainstall.py | 10 +---------
 5 files changed, 1 insertion(+), 39 deletions(-)

diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py
index 41dae3004d1f4836e79c2048ae0a12f722595ca0..6242c19636168a5b2922f6f6f0e8bc8aa9b4bc80 100644
--- a/ipaclient/install/client.py
+++ b/ipaclient/install/client.py
@@ -38,8 +38,6 @@ from ipalib.install.kinit import kinit_keytab, kinit_password
 from ipalib.install.service import enroll_only, prepare_only
 from ipalib.rpc import delete_persistent_client_session_data
 from ipalib.util import (
-    broadcast_ip_address_warning,
-    network_ip_address_warning,
     normalize_hostname,
     no_matching_interface_for_ip_address_warning,
     verify_host_resolvable,
@@ -1299,8 +1297,6 @@ def update_dns(server, hostname, options):
         root_logger.info("Failed to determine this machine's ip address(es).")
         return
 
-    network_ip_address_warning(update_ips)
-    broadcast_ip_address_warning(update_ips)
     no_matching_interface_for_ip_address_warning(update_ips)
 
     update_txt = "debug\n"
diff --git a/ipalib/util.py b/ipalib/util.py
index 1bd8495a49b010e7a3ac926dad516ab5f8219b39..31e73230da49a47e8e0fbcba9934f13cef16460e 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -1110,26 +1110,6 @@ def check_principal_realm_in_trust_namespace(api_instance, *keys):
                         'namespace'))
 
 
-def network_ip_address_warning(addr_list):
-    for ip in addr_list:
-        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)
-
-
-def broadcast_ip_address_warning(addr_list):
-    for ip in addr_list:
-        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)
-
-
 def no_matching_interface_for_ip_address_warning(addr_list):
     for ip in addr_list:
         if not ip.get_matching_interface():
diff --git a/ipaserver/install/dns.py b/ipaserver/install/dns.py
index 090b79493652566a433da248fa7fd9e33dd2cb72..1c1aac06a18fe3c1f63b5881c7887f6a4cfc9ac2 100644
--- a/ipaserver/install/dns.py
+++ b/ipaserver/install/dns.py
@@ -264,8 +264,6 @@ def install_check(standalone, api, replica, options, hostname):
     ip_addresses = get_server_ip_address(hostname, options.unattended,
                                          True, options.ip_addresses)
 
-    util.network_ip_address_warning(ip_addresses)
-    util.broadcast_ip_address_warning(ip_addresses)
     util.no_matching_interface_for_ip_address_warning(ip_addresses)
 
     if not options.forward_policy:
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
index 7eb291e07c00e0407ce534c3d4088e6f6378260f..dced253e7f039dc9d66466bf8bcd777e53919f54 100644
--- a/ipaserver/install/server/install.py
+++ b/ipaserver/install/server/install.py
@@ -27,8 +27,6 @@ from ipalib import api, errors, x509
 from ipalib.constants import DOMAIN_LEVEL_0
 from ipalib.util import (
     validate_domain_name,
-    network_ip_address_warning,
-    broadcast_ip_address_warning,
     no_matching_interface_for_ip_address_warning,
 )
 import ipaclient.install.ntpconf
@@ -616,8 +614,6 @@ def install_check(installer):
                                              options.ip_addresses)
 
         # check addresses here, dns module is doing own check
-        network_ip_address_warning(ip_addresses)
-        broadcast_ip_address_warning(ip_addresses)
         no_matching_interface_for_ip_address_warning(ip_addresses)
 
     if options.setup_adtrust:
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
index 9e328bf83bbdb2883ba823cb098b70eeaa078403..4f28de25bd0adf958187c19edf90de4ba57dd98e 100644
--- a/ipaserver/install/server/replicainstall.py
+++ b/ipaserver/install/server/replicainstall.py
@@ -32,11 +32,7 @@ from ipaplatform.tasks import tasks
 from ipaplatform.paths import paths
 from ipalib import api, constants, create_api, errors, rpc, x509
 from ipalib.config import Env
-from ipalib.util import (
-    network_ip_address_warning,
-    broadcast_ip_address_warning,
-    no_matching_interface_for_ip_address_warning,
-)
+from ipalib.util import no_matching_interface_for_ip_address_warning
 from ipaclient.install.client import configure_krb5_conf, purge_host_keytab
 from ipaserver.install import (
     adtrust, bindinstance, ca, certs, dns, dsinstance, httpinstance,
@@ -852,8 +848,6 @@ def install_check(installer):
                 options.ip_addresses)
 
             # check addresses here, dns module is doing own check
-            network_ip_address_warning(config.ips)
-            broadcast_ip_address_warning(config.ips)
             no_matching_interface_for_ip_address_warning(config.ips)
 
         if options.setup_adtrust:
@@ -1285,8 +1279,6 @@ def promote_check(installer):
                 False, options.ip_addresses)
 
             # check addresses here, dns module is doing own check
-            network_ip_address_warning(config.ips)
-            broadcast_ip_address_warning(config.ips)
             no_matching_interface_for_ip_address_warning(config.ips)
 
         if options.setup_adtrust:
-- 
2.9.4