From 121e17d15dcf311f8e629788d74df10f7c291676 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 12 Jan 2012 16:55:50 +0100 Subject: [PATCH 11/13] Fix pylint warnings W0141 (used builtin function xyz) From: Juerg Haefliger Replace superseded builtin functions 'filter' and 'map' using list comprehension. --- cloudinit/DataSource.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cloudinit/DataSource.py') diff --git a/cloudinit/DataSource.py b/cloudinit/DataSource.py index 623f96b6..ac79f757 100644 --- a/cloudinit/DataSource.py +++ b/cloudinit/DataSource.py @@ -199,8 +199,8 @@ def is_ipv4(instr): return False try: - filter(lambda x: int(x) < 256 and x > 0, toks) + toks = [x for x in toks if (int(x) < 256 and int(x) > 0)] except: return False - return True + return (len(toks) == 4) -- cgit v1.2.3