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/sources/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cloudinit/sources') diff --git a/cloudinit/sources/__init__.py b/cloudinit/sources/__init__.py index a6e6d202..923e3cea 100644 --- a/cloudinit/sources/__init__.py +++ b/cloudinit/sources/__init__.py @@ -602,7 +602,7 @@ class DataSource(metaclass=abc.ABCMeta): # if there is an ipv4 address in 'local-hostname', then # make up a hostname (LP: #475354) in format ip-xx.xx.xx.xx lhost = self.metadata['local-hostname'] - if util.is_ipv4(lhost): + if net.is_ipv4_address(lhost): toks = [] if resolve_ip: toks = util.gethostbyaddr(lhost) -- cgit v1.2.3