summaryrefslogtreecommitdiff
path: root/cloudinit/mergers/m_str.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-03-14 14:16:49 -0400
committerScott Moser <smoser@ubuntu.com>2016-03-14 14:16:49 -0400
commit92db1b884bf34339a4536a20123c45b01c9c49ce (patch)
tree22be0de3d0496212d26015c3b30423da9338aa5c /cloudinit/mergers/m_str.py
parent91ccf1b55b5b79694449446b029dd7c4570517a5 (diff)
parent72f826bff694b612d54b177635ca7e0dc83aed2f (diff)
downloadvyos-cloud-init-92db1b884bf34339a4536a20123c45b01c9c49ce.tar.gz
vyos-cloud-init-92db1b884bf34339a4536a20123c45b01c9c49ce.zip
merge with trunk
Diffstat (limited to 'cloudinit/mergers/m_str.py')
-rw-r--r--cloudinit/mergers/m_str.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/cloudinit/mergers/m_str.py b/cloudinit/mergers/m_str.py
index e22ce28a..b00c4bf3 100644
--- a/cloudinit/mergers/m_str.py
+++ b/cloudinit/mergers/m_str.py
@@ -17,6 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import six
+
class Merger(object):
def __init__(self, _merger, opts):
@@ -34,11 +36,11 @@ 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, (basestring)):
+ if not isinstance(value, six.string_types):
return merge_with
if not self._append:
return merge_with
- if isinstance(value, unicode):
- return value + unicode(merge_with)
+ if isinstance(value, six.text_type):
+ return value + six.text_type(merge_with)
else:
- return value + str(merge_with)
+ return value + six.binary_type(merge_with)