diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-03-22 21:59:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-22 21:59:35 +0100 |
commit | fa62d104dc7a860d3a2237b4431e5c5fc6ad7457 (patch) | |
tree | 6a17662b4d0a24b58f07c9ce23be43c7204bdeb2 | |
parent | eeb9687bb9aaf6050b0a8759767f08ab8faac442 (diff) | |
parent | 5d0a54ec53c18289f50ccb9cd69e0df62c63a2dc (diff) | |
download | vyos-1x-fa62d104dc7a860d3a2237b4431e5c5fc6ad7457.tar.gz vyos-1x-fa62d104dc7a860d3a2237b4431e5c5fc6ad7457.zip |
Merge pull request #781 from erkin/current
util: T3419: Handle IP addresses with netmasks and subnet prefixes in strip-private
-rwxr-xr-x | src/helpers/strip-private.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/helpers/strip-private.py b/src/helpers/strip-private.py index 23761e578..023298eec 100755 --- a/src/helpers/strip-private.py +++ b/src/helpers/strip-private.py @@ -19,7 +19,7 @@ import argparse import re import sys -from netaddr import IPAddress, AddrFormatError +from netaddr import IPNetwork, AddrFormatError parser = argparse.ArgumentParser(description='strip off private information from VyOS config') @@ -58,7 +58,7 @@ def ip_match(match: re.Match, subst: str) -> str: result = match.group(0) # Is this a valid IP address? try: - addr = IPAddress(result) + addr = IPNetwork(result).ip # No? Then we've got nothing to do with it. except AddrFormatError: return result |