From 6d0e6068f2692fd34c3c5cc93af7ec8ef5be4711 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Tue, 7 Jun 2016 10:59:27 -0700 Subject: For now just remove compat.py module Let's reduce the size of this change for now. --- cloudinit/net/cmdline.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cloudinit/net/cmdline.py') diff --git a/cloudinit/net/cmdline.py b/cloudinit/net/cmdline.py index 187f7026..822a020b 100644 --- a/cloudinit/net/cmdline.py +++ b/cloudinit/net/cmdline.py @@ -21,16 +21,20 @@ import glob import gzip import io import shlex +import sys + +import six -from . import compat from . import get_devicelist from . import sys_netdev_info from cloudinit import util +PY26 = sys.version_info[0:2] == (2, 6) + def _shlex_split(blob): - if compat.PY26 and isinstance(blob, compat.text_type): + if PY26 and isinstance(blob, six.text_type): # Older versions don't support unicode input blob = blob.encode("utf8") return shlex.split(blob) @@ -42,7 +46,7 @@ def _load_shell_content(content, add_empty=False, empty_val=None): then add entries in to the returned dictionary for 'VAR=' variables. Set their value to empty_val.""" data = {} - for line in shlex.split(content): + for line in _shlex_split(content): key, value = line.split("=", 1) if not value: value = empty_val -- cgit v1.2.3