diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-04-01 16:57:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-01 16:57:26 -0400 |
commit | 95ef35d219daa2a207ed7bd30e961101935770e4 (patch) | |
tree | 2f8f6bab3ad52162cecdc89a99aadbea09aa5b55 /cloudinit/util.py | |
parent | 9efa64f5a7142466a70df805787a4ab347fd9eba (diff) | |
download | vyos-cloud-init-95ef35d219daa2a207ed7bd30e961101935770e4.tar.gz vyos-cloud-init-95ef35d219daa2a207ed7bd30e961101935770e4.zip |
util: remove unnecessary lru_cache import fallback (#299)
functools.lru_cache has been present since Python 3.2, so we no longer need to handle its absence.
(Also sort util's imports while we're modifying them.)
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index f8e28d2d..818904b1 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -31,32 +31,22 @@ import string import subprocess import sys import time -from urllib import parse - -from errno import ENOENT, ENOEXEC - from base64 import b64decode, b64encode +from errno import ENOENT, ENOEXEC +from functools import lru_cache +from urllib import parse from cloudinit import importer from cloudinit import log as logging -from cloudinit import mergers -from cloudinit import safeyaml -from cloudinit import temp_utils -from cloudinit import type_utils -from cloudinit import url_helper -from cloudinit import version - -from cloudinit.settings import (CFG_BUILTIN) - -try: - from functools import lru_cache -except ImportError: - def lru_cache(): - """pass-thru replace for Python3's lru_cache()""" - def wrapper(f): - return f - return wrapper - +from cloudinit import ( + mergers, + safeyaml, + temp_utils, + type_utils, + url_helper, + version, +) +from cloudinit.settings import CFG_BUILTIN _DNS_REDIRECT_IP = None LOG = logging.getLogger(__name__) |