summaryrefslogtreecommitdiff
path: root/cloudinit/net/cmdline.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2016-05-24 13:48:50 -0700
committerJoshua Harlow <harlowja@gmail.com>2016-05-24 13:48:50 -0700
commit85a53d66ad0241b2d6453d902487bb2edc1512b8 (patch)
treef52cff059de9fdb0aab88ba3ecba3dc2f0badced /cloudinit/net/cmdline.py
parentef47b4f4c14ffe1337508f85f365b338a048a5a1 (diff)
downloadvyos-cloud-init-85a53d66ad0241b2d6453d902487bb2edc1512b8.tar.gz
vyos-cloud-init-85a53d66ad0241b2d6453d902487bb2edc1512b8.zip
Fix up some of the net usage and restore imports and add a mini compat module
Diffstat (limited to 'cloudinit/net/cmdline.py')
-rw-r--r--cloudinit/net/cmdline.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/cloudinit/net/cmdline.py b/cloudinit/net/cmdline.py
index b85d4b0a..41cba893 100644
--- a/cloudinit/net/cmdline.py
+++ b/cloudinit/net/cmdline.py
@@ -21,20 +21,17 @@ import glob
import gzip
import io
import shlex
-import sys
-import six
-
-from cloudinit.net import get_devicelist
-from cloudinit.net import sys_netdev_info
+from . import compat
+from . import get_devicelist
+from . import read_file
+from . import sys_netdev_info
from cloudinit import util
-PY26 = sys.version_info[0:2] == (2, 6)
-
def _shlex_split(blob):
- if PY26 and isinstance(blob, six.text_type):
+ if compat.PY26 and isinstance(blob, compat.text_type):
# Older versions don't support unicode input
blob = blob.encode("utf8")
return shlex.split(blob)
@@ -143,7 +140,7 @@ def config_from_klibc_net_cfg(files=None, mac_addrs=None):
entries = []
names = {}
for cfg_file in files:
- name, entry = _klibc_to_config_entry(util.load_file(cfg_file),
+ name, entry = _klibc_to_config_entry(read_file(cfg_file),
mac_addrs=mac_addrs)
if name in names:
raise ValueError(