diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-03-30 23:02:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-30 21:02:44 -0600 |
commit | 4f825b3e6d8fde5c239d29639b04d2bea6d95d0e (patch) | |
tree | 4d73682ac9118d057e1009aae02e18f3139e5244 /cloudinit/util.py | |
parent | ee0377924aa6bcd072dc5836dbf8ac51110bd87d (diff) | |
download | vyos-cloud-init-4f825b3e6d8fde5c239d29639b04d2bea6d95d0e.tar.gz vyos-cloud-init-4f825b3e6d8fde5c239d29639b04d2bea6d95d0e.zip |
cloudinit: refactor util.is_ipv4 to net.is_ipv4_address (#292)
This also simplifies the implementation to rely on the stdlib, instead
of our own NIH checking.
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index 541a486b..f8e28d2d 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -528,20 +528,6 @@ def multi_log(text, console=True, stderr=True, log.log(log_level, text) -def is_ipv4(instr): - """determine if input string is a ipv4 address. return boolean.""" - toks = instr.split('.') - if len(toks) != 4: - return False - - try: - toks = [x for x in toks if 0 <= int(x) < 256] - except Exception: - return False - - return len(toks) == 4 - - @lru_cache() def is_BSD(): return 'BSD' in platform.system() |