From 2e748b47277c05607c8f3883fe954b59444b2f65 Mon Sep 17 00:00:00 2001 From: mpgn Date: Tue, 21 Sep 2021 09:29:07 +0000 Subject: [PATCH 1/2] Update ip.py --- cme/parsers/ip.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cme/parsers/ip.py b/cme/parsers/ip.py index fa00eb96..41b42116 100755 --- a/cme/parsers/ip.py +++ b/cme/parsers/ip.py @@ -1,4 +1,4 @@ -from ipaddress import ip_address, ip_network, summarize_address_range +from ipaddress import ip_address, ip_network, summarize_address_range, ip_interface def parse_targets(target): try: @@ -17,10 +17,11 @@ def parse_targets(target): for ip in ip_range: yield str(ip) else: - if ip_address(target).is_link_local: + if ip_interface(target).ip.version == 6 and ip_address(target).is_link_local: yield str(target) else: for ip in ip_network(target, strict=False): - yield str(ip) - except ValueError: + yield str(ip) + except ValueError as e: + print(e) yield str(target) From 3d0331f7140c5819bbe4284869d458d6513380e4 Mon Sep 17 00:00:00 2001 From: mpgn Date: Tue, 21 Sep 2021 11:46:06 +0000 Subject: [PATCH 2/2] Update ip.py --- cme/parsers/ip.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cme/parsers/ip.py b/cme/parsers/ip.py index 41b42116..e94c8383 100755 --- a/cme/parsers/ip.py +++ b/cme/parsers/ip.py @@ -23,5 +23,4 @@ def parse_targets(target): for ip in ip_network(target, strict=False): yield str(ip) except ValueError as e: - print(e) yield str(target)