diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-01-21 18:02:42 -0500 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2020-01-21 16:02:42 -0700 |
commit | bb71a9d08d25193836eda91c328760305285574e (patch) | |
tree | 50a1f2f4a61e04255c5a8129e7a2a26d9d4cecd4 /cloudinit/net/sysconfig.py | |
parent | 8c4fd886931abcf2cc8627a47463907d655b35c3 (diff) | |
download | vyos-cloud-init-bb71a9d08d25193836eda91c328760305285574e.tar.gz vyos-cloud-init-bb71a9d08d25193836eda91c328760305285574e.zip |
Drop most of the remaining use of six (#179)
Diffstat (limited to 'cloudinit/net/sysconfig.py')
-rw-r--r-- | cloudinit/net/sysconfig.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py index 3e06af01..07668d3e 100644 --- a/cloudinit/net/sysconfig.py +++ b/cloudinit/net/sysconfig.py @@ -1,16 +1,15 @@ # This file is part of cloud-init. See LICENSE file for license information. +import io import os import re -import six +from configobj import ConfigObj -from cloudinit.distros.parsers import networkmanager_conf -from cloudinit.distros.parsers import resolv_conf from cloudinit import log as logging from cloudinit import util - -from configobj import ConfigObj +from cloudinit.distros.parsers import networkmanager_conf +from cloudinit.distros.parsers import resolv_conf from . import renderer from .network_state import ( @@ -96,7 +95,7 @@ class ConfigMap(object): return len(self._conf) def to_string(self): - buf = six.StringIO() + buf = io.StringIO() buf.write(_make_header()) if self._conf: buf.write("\n") @@ -104,7 +103,7 @@ class ConfigMap(object): value = self._conf[key] if isinstance(value, bool): value = self._bool_map[value] - if not isinstance(value, six.string_types): + if not isinstance(value, str): value = str(value) buf.write("%s=%s\n" % (key, _quote_value(value))) return buf.getvalue() @@ -150,7 +149,7 @@ class Route(ConfigMap): # only accept ipv4 and ipv6 if proto not in ['ipv4', 'ipv6']: raise ValueError("Unknown protocol '%s'" % (str(proto))) - buf = six.StringIO() + buf = io.StringIO() buf.write(_make_header()) if self._conf: buf.write("\n") |