location-importer.in: reduce log noise for unusable networks

Message ID 42bc8670-24ec-e10f-fce8-2a1452d26420@ipfire.org
State Accepted
Commit 2ba6ed07120a8305265568d528e1bd554168bfc6
Headers
Series location-importer.in: reduce log noise for unusable networks |

Commit Message

Peter Müller Jan. 16, 2021, 6:09 p.m. UTC
  These are nothing to worry about, which is why debug log facility is
more suitable here than informational or warning.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 src/python/location-importer.in | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Comments

Michael Tremer Jan. 25, 2021, 9:32 p.m. UTC | #1
Hi,

Thank you again.

This won’t be rolled out, yet, because I would need to build new Debian packages for it.

Since we do not have many changes since the last tag, I wouldn’t do this yet. Agreed?

-Michael

> On 16 Jan 2021, at 18:09, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> These are nothing to worry about, which is why debug log facility is
> more suitable here than informational or warning.
> 
> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
> ---
> src/python/location-importer.in | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/python/location-importer.in b/src/python/location-importer.in
> index a4be445..c5ebb54 100644
> --- a/src/python/location-importer.in
> +++ b/src/python/location-importer.in
> @@ -494,12 +494,12 @@ class CLI(object):
> 			return False
> 
> 		if not network.is_global:
> -			log.warning("Skipping non-globally routable network: %s" % network)
> +			log.debug("Skipping non-globally routable network: %s" % network)
> 			return False
> 
> 		if network.version == 4:
> 			if network.prefixlen < 7:
> -				log.warning("Skipping too big IP chunk: %s" % network)
> +				log.debug("Skipping too big IP chunk: %s" % network)
> 				return False
> 
> 			if network.prefixlen > 24:
> @@ -507,12 +507,12 @@ class CLI(object):
> 				return False
> 
> 			if str(network.network_address) == "0.0.0.0":
> -				log.warning("Skipping network based on 0.0.0.0: %s" % network)
> +				log.debug("Skipping network based on 0.0.0.0: %s" % network)
> 				return False
> 
> 		elif network.version == 6:
> 			if network.prefixlen < 10:
> -				log.warning("Skipping too big IP chunk: %s" % network)
> +				log.debug("Skipping too big IP chunk: %s" % network)
> 				return False
> 
> 			if network.prefixlen > 48:
> @@ -520,7 +520,7 @@ class CLI(object):
> 				return False
> 
> 			if str(network.network_address) == "::":
> -				log.warning("Skipping network based on '::': %s" % network)
> +				log.debug("Skipping network based on '::': %s" % network)
> 				return False
> 
> 		else:
> @@ -587,7 +587,7 @@ class CLI(object):
> 			# not managed by that specific RIR...
> 			if key == "netname":
> 				if re.match(r"(ERX-NETBLOCK|(AFRINIC|ARIN|LACNIC|RIPE)-CIDR-BLOCK|IANA-NETBLOCK-\d{1,3}|NON-RIPE-NCC-MANAGED-ADDRESS-BLOCK)", val.strip()):
> -					log.warning("Skipping record indicating historic/orphaned data: %s" % val.strip())
> +					log.debug("Skipping record indicating historic/orphaned data: %s" % val.strip())
> 					return
> 
> 			if key == "inetnum":
> -- 
> 2.26.2
  

Patch

diff --git a/src/python/location-importer.in b/src/python/location-importer.in
index a4be445..c5ebb54 100644
--- a/src/python/location-importer.in
+++ b/src/python/location-importer.in
@@ -494,12 +494,12 @@  class CLI(object):
 			return False
 
 		if not network.is_global:
-			log.warning("Skipping non-globally routable network: %s" % network)
+			log.debug("Skipping non-globally routable network: %s" % network)
 			return False
 
 		if network.version == 4:
 			if network.prefixlen < 7:
-				log.warning("Skipping too big IP chunk: %s" % network)
+				log.debug("Skipping too big IP chunk: %s" % network)
 				return False
 
 			if network.prefixlen > 24:
@@ -507,12 +507,12 @@  class CLI(object):
 				return False
 
 			if str(network.network_address) == "0.0.0.0":
-				log.warning("Skipping network based on 0.0.0.0: %s" % network)
+				log.debug("Skipping network based on 0.0.0.0: %s" % network)
 				return False
 
 		elif network.version == 6:
 			if network.prefixlen < 10:
-				log.warning("Skipping too big IP chunk: %s" % network)
+				log.debug("Skipping too big IP chunk: %s" % network)
 				return False
 
 			if network.prefixlen > 48:
@@ -520,7 +520,7 @@  class CLI(object):
 				return False
 
 			if str(network.network_address) == "::":
-				log.warning("Skipping network based on '::': %s" % network)
+				log.debug("Skipping network based on '::': %s" % network)
 				return False
 
 		else:
@@ -587,7 +587,7 @@  class CLI(object):
 			# not managed by that specific RIR...
 			if key == "netname":
 				if re.match(r"(ERX-NETBLOCK|(AFRINIC|ARIN|LACNIC|RIPE)-CIDR-BLOCK|IANA-NETBLOCK-\d{1,3}|NON-RIPE-NCC-MANAGED-ADDRESS-BLOCK)", val.strip()):
-					log.warning("Skipping record indicating historic/orphaned data: %s" % val.strip())
+					log.debug("Skipping record indicating historic/orphaned data: %s" % val.strip())
 					return
 
 			if key == "inetnum":