summaryrefslogtreecommitdiff
path: root/cloudinit/sources
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2020-03-30 23:02:44 -0400
committerGitHub <noreply@github.com>2020-03-30 21:02:44 -0600
commit4f825b3e6d8fde5c239d29639b04d2bea6d95d0e (patch)
tree4d73682ac9118d057e1009aae02e18f3139e5244 /cloudinit/sources
parentee0377924aa6bcd072dc5836dbf8ac51110bd87d (diff)
downloadvyos-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/sources')
-rw-r--r--cloudinit/sources/__init__.py2
1 files changed, 1 insertions, 1 deletions
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)