From 4f825b3e6d8fde5c239d29639b04d2bea6d95d0e Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Mon, 30 Mar 2020 23:02:44 -0400 Subject: 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. --- cloudinit/util.py | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'cloudinit/util.py') 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() -- cgit v1.2.3