summaryrefslogtreecommitdiff
path: root/cloudinit/mergers/m_str.py
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2020-01-21 17:15:30 -0500
committerGitHub <noreply@github.com>2020-01-21 17:15:30 -0500
commit8c4fd886931abcf2cc8627a47463907d655b35c3 (patch)
tree5abcf1140d58c0498da01fa746d5581558423d2c /cloudinit/mergers/m_str.py
parent0562ca696fe1a36b6c3b2fb576068e05033f6f3f (diff)
downloadvyos-cloud-init-8c4fd886931abcf2cc8627a47463907d655b35c3.tar.gz
vyos-cloud-init-8c4fd886931abcf2cc8627a47463907d655b35c3.zip
Start removing dependency on six (#178)
* url_helper: drop six * url_helper: sort imports * log: drop six * log: sort imports * handlers/__init__: drop six * handlers/__init__: sort imports * user_data: drop six * user_data: sort imports * sources/__init__: drop six * sources/__init__: sort imports * DataSourceOVF: drop six * DataSourceOVF: sort imports * sources/helpers/openstack: drop six * sources/helpers/openstack: sort imports * mergers/m_str: drop six This also allowed simplification of the logic, as we will never encounter a non-string text type. * type_utils: drop six * mergers/m_dict: drop six * mergers/m_list: drop six * cmd/query: drop six * mergers/__init__: drop six * net/cmdline: drop six * reporting/handlers: drop six * reporting/handlers: sort imports
Diffstat (limited to 'cloudinit/mergers/m_str.py')
-rw-r--r--cloudinit/mergers/m_str.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/cloudinit/mergers/m_str.py b/cloudinit/mergers/m_str.py
index 629df58e..539e3e29 100644
--- a/cloudinit/mergers/m_str.py
+++ b/cloudinit/mergers/m_str.py
@@ -4,8 +4,6 @@
#
# This file is part of cloud-init. See LICENSE file for license information.
-import six
-
class Merger(object):
def __init__(self, _merger, opts):
@@ -23,13 +21,10 @@ class Merger(object):
# perform the following action, if appending we will
# merge them together, otherwise we will just return value.
def _on_str(self, value, merge_with):
- if not isinstance(value, six.string_types):
+ if not isinstance(value, str):
return merge_with
if not self._append:
return merge_with
- if isinstance(value, six.text_type):
- return value + six.text_type(merge_with)
- else:
- return value + six.binary_type(merge_with)
+ return value + merge_with
# vi: ts=4 expandtab