|
|
ac7d03 |
From 52be5b4d693febdc1fa1fe9d54b1d052a09c347f Mon Sep 17 00:00:00 2001
|
|
|
ac7d03 |
From: Martin Basti <mbasti@redhat.com>
|
|
|
ac7d03 |
Date: Thu, 15 Jun 2017 10:27:55 +0200
|
|
|
ac7d03 |
Subject: [PATCH] Remove network and broadcast address warnings
|
|
|
ac7d03 |
|
|
|
ac7d03 |
We cannot reliably determine when an IP Address is network or broadcast.
|
|
|
ac7d03 |
We allowed to use non-local IP addresses due container use cases, we
|
|
|
ac7d03 |
don't know subnets of used IP addresses.
|
|
|
ac7d03 |
|
|
|
ac7d03 |
https://pagure.io/freeipa/issue/4317
|
|
|
ac7d03 |
|
|
|
ac7d03 |
Reviewed-By: David Kupka <dkupka@redhat.com>
|
|
|
ac7d03 |
---
|
|
|
ac7d03 |
ipaclient/install/client.py | 4 ----
|
|
|
ac7d03 |
ipalib/util.py | 20 --------------------
|
|
|
ac7d03 |
ipaserver/install/dns.py | 2 --
|
|
|
ac7d03 |
ipaserver/install/server/install.py | 4 ----
|
|
|
ac7d03 |
ipaserver/install/server/replicainstall.py | 10 +---------
|
|
|
ac7d03 |
5 files changed, 1 insertion(+), 39 deletions(-)
|
|
|
ac7d03 |
|
|
|
ac7d03 |
diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py
|
|
|
ac7d03 |
index 41dae3004d1f4836e79c2048ae0a12f722595ca0..6242c19636168a5b2922f6f6f0e8bc8aa9b4bc80 100644
|
|
|
ac7d03 |
--- a/ipaclient/install/client.py
|
|
|
ac7d03 |
+++ b/ipaclient/install/client.py
|
|
|
ac7d03 |
@@ -38,8 +38,6 @@ from ipalib.install.kinit import kinit_keytab, kinit_password
|
|
|
ac7d03 |
from ipalib.install.service import enroll_only, prepare_only
|
|
|
ac7d03 |
from ipalib.rpc import delete_persistent_client_session_data
|
|
|
ac7d03 |
from ipalib.util import (
|
|
|
ac7d03 |
- broadcast_ip_address_warning,
|
|
|
ac7d03 |
- network_ip_address_warning,
|
|
|
ac7d03 |
normalize_hostname,
|
|
|
ac7d03 |
no_matching_interface_for_ip_address_warning,
|
|
|
ac7d03 |
verify_host_resolvable,
|
|
|
ac7d03 |
@@ -1299,8 +1297,6 @@ def update_dns(server, hostname, options):
|
|
|
ac7d03 |
root_logger.info("Failed to determine this machine's ip address(es).")
|
|
|
ac7d03 |
return
|
|
|
ac7d03 |
|
|
|
ac7d03 |
- network_ip_address_warning(update_ips)
|
|
|
ac7d03 |
- broadcast_ip_address_warning(update_ips)
|
|
|
ac7d03 |
no_matching_interface_for_ip_address_warning(update_ips)
|
|
|
ac7d03 |
|
|
|
ac7d03 |
update_txt = "debug\n"
|
|
|
ac7d03 |
diff --git a/ipalib/util.py b/ipalib/util.py
|
|
|
ac7d03 |
index 1bd8495a49b010e7a3ac926dad516ab5f8219b39..31e73230da49a47e8e0fbcba9934f13cef16460e 100644
|
|
|
ac7d03 |
--- a/ipalib/util.py
|
|
|
ac7d03 |
+++ b/ipalib/util.py
|
|
|
ac7d03 |
@@ -1110,26 +1110,6 @@ def check_principal_realm_in_trust_namespace(api_instance, *keys):
|
|
|
ac7d03 |
'namespace'))
|
|
|
ac7d03 |
|
|
|
ac7d03 |
|
|
|
ac7d03 |
-def network_ip_address_warning(addr_list):
|
|
|
ac7d03 |
- for ip in addr_list:
|
|
|
ac7d03 |
- if ip.is_network_addr():
|
|
|
ac7d03 |
- root_logger.warning("IP address %s might be network address", ip)
|
|
|
ac7d03 |
- # fixme: once when loggers will be fixed, we can remove this
|
|
|
ac7d03 |
- # print
|
|
|
ac7d03 |
- print("WARNING: IP address {} might be network address".format(ip),
|
|
|
ac7d03 |
- file=sys.stderr)
|
|
|
ac7d03 |
-
|
|
|
ac7d03 |
-
|
|
|
ac7d03 |
-def broadcast_ip_address_warning(addr_list):
|
|
|
ac7d03 |
- for ip in addr_list:
|
|
|
ac7d03 |
- if ip.is_broadcast_addr():
|
|
|
ac7d03 |
- root_logger.warning("IP address %s might be broadcast address", ip)
|
|
|
ac7d03 |
- # fixme: once when loggers will be fixed, we can remove this
|
|
|
ac7d03 |
- # print
|
|
|
ac7d03 |
- print("WARNING: IP address {} might be broadcast address".format(
|
|
|
ac7d03 |
- ip), file=sys.stderr)
|
|
|
ac7d03 |
-
|
|
|
ac7d03 |
-
|
|
|
ac7d03 |
def no_matching_interface_for_ip_address_warning(addr_list):
|
|
|
ac7d03 |
for ip in addr_list:
|
|
|
ac7d03 |
if not ip.get_matching_interface():
|
|
|
ac7d03 |
diff --git a/ipaserver/install/dns.py b/ipaserver/install/dns.py
|
|
|
ac7d03 |
index 090b79493652566a433da248fa7fd9e33dd2cb72..1c1aac06a18fe3c1f63b5881c7887f6a4cfc9ac2 100644
|
|
|
ac7d03 |
--- a/ipaserver/install/dns.py
|
|
|
ac7d03 |
+++ b/ipaserver/install/dns.py
|
|
|
ac7d03 |
@@ -264,8 +264,6 @@ def install_check(standalone, api, replica, options, hostname):
|
|
|
ac7d03 |
ip_addresses = get_server_ip_address(hostname, options.unattended,
|
|
|
ac7d03 |
True, options.ip_addresses)
|
|
|
ac7d03 |
|
|
|
ac7d03 |
- util.network_ip_address_warning(ip_addresses)
|
|
|
ac7d03 |
- util.broadcast_ip_address_warning(ip_addresses)
|
|
|
ac7d03 |
util.no_matching_interface_for_ip_address_warning(ip_addresses)
|
|
|
ac7d03 |
|
|
|
ac7d03 |
if not options.forward_policy:
|
|
|
ac7d03 |
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
|
|
|
ac7d03 |
index 7eb291e07c00e0407ce534c3d4088e6f6378260f..dced253e7f039dc9d66466bf8bcd777e53919f54 100644
|
|
|
ac7d03 |
--- a/ipaserver/install/server/install.py
|
|
|
ac7d03 |
+++ b/ipaserver/install/server/install.py
|
|
|
ac7d03 |
@@ -27,8 +27,6 @@ from ipalib import api, errors, x509
|
|
|
ac7d03 |
from ipalib.constants import DOMAIN_LEVEL_0
|
|
|
ac7d03 |
from ipalib.util import (
|
|
|
ac7d03 |
validate_domain_name,
|
|
|
ac7d03 |
- network_ip_address_warning,
|
|
|
ac7d03 |
- broadcast_ip_address_warning,
|
|
|
ac7d03 |
no_matching_interface_for_ip_address_warning,
|
|
|
ac7d03 |
)
|
|
|
ac7d03 |
import ipaclient.install.ntpconf
|
|
|
ac7d03 |
@@ -616,8 +614,6 @@ def install_check(installer):
|
|
|
ac7d03 |
options.ip_addresses)
|
|
|
ac7d03 |
|
|
|
ac7d03 |
# check addresses here, dns module is doing own check
|
|
|
ac7d03 |
- network_ip_address_warning(ip_addresses)
|
|
|
ac7d03 |
- broadcast_ip_address_warning(ip_addresses)
|
|
|
ac7d03 |
no_matching_interface_for_ip_address_warning(ip_addresses)
|
|
|
ac7d03 |
|
|
|
ac7d03 |
if options.setup_adtrust:
|
|
|
ac7d03 |
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
|
|
|
ac7d03 |
index 9e328bf83bbdb2883ba823cb098b70eeaa078403..4f28de25bd0adf958187c19edf90de4ba57dd98e 100644
|
|
|
ac7d03 |
--- a/ipaserver/install/server/replicainstall.py
|
|
|
ac7d03 |
+++ b/ipaserver/install/server/replicainstall.py
|
|
|
ac7d03 |
@@ -32,11 +32,7 @@ from ipaplatform.tasks import tasks
|
|
|
ac7d03 |
from ipaplatform.paths import paths
|
|
|
ac7d03 |
from ipalib import api, constants, create_api, errors, rpc, x509
|
|
|
ac7d03 |
from ipalib.config import Env
|
|
|
ac7d03 |
-from ipalib.util import (
|
|
|
ac7d03 |
- network_ip_address_warning,
|
|
|
ac7d03 |
- broadcast_ip_address_warning,
|
|
|
ac7d03 |
- no_matching_interface_for_ip_address_warning,
|
|
|
ac7d03 |
-)
|
|
|
ac7d03 |
+from ipalib.util import no_matching_interface_for_ip_address_warning
|
|
|
ac7d03 |
from ipaclient.install.client import configure_krb5_conf, purge_host_keytab
|
|
|
ac7d03 |
from ipaserver.install import (
|
|
|
ac7d03 |
adtrust, bindinstance, ca, certs, dns, dsinstance, httpinstance,
|
|
|
ac7d03 |
@@ -852,8 +848,6 @@ def install_check(installer):
|
|
|
ac7d03 |
options.ip_addresses)
|
|
|
ac7d03 |
|
|
|
ac7d03 |
# check addresses here, dns module is doing own check
|
|
|
ac7d03 |
- network_ip_address_warning(config.ips)
|
|
|
ac7d03 |
- broadcast_ip_address_warning(config.ips)
|
|
|
ac7d03 |
no_matching_interface_for_ip_address_warning(config.ips)
|
|
|
ac7d03 |
|
|
|
ac7d03 |
if options.setup_adtrust:
|
|
|
ac7d03 |
@@ -1285,8 +1279,6 @@ def promote_check(installer):
|
|
|
ac7d03 |
False, options.ip_addresses)
|
|
|
ac7d03 |
|
|
|
ac7d03 |
# check addresses here, dns module is doing own check
|
|
|
ac7d03 |
- network_ip_address_warning(config.ips)
|
|
|
ac7d03 |
- broadcast_ip_address_warning(config.ips)
|
|
|
ac7d03 |
no_matching_interface_for_ip_address_warning(config.ips)
|
|
|
ac7d03 |
|
|
|
ac7d03 |
if options.setup_adtrust:
|
|
|
ac7d03 |
--
|
|
|
ac7d03 |
2.9.4
|
|
|
ac7d03 |
|