summaryrefslogtreecommitdiff
path: root/cloudinit/cs_utils.py
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2015-07-16 10:12:24 +0100
committerDaniel Watkins <daniel.watkins@canonical.com>2015-07-16 10:12:24 +0100
commitc33ac7e2deecadeb7f34dacc4e91a3cad2c87ffd (patch)
tree44e45190b83194c718f68c6ebd96061b6801acb2 /cloudinit/cs_utils.py
parent8711d6ab60f25ee8604fd777c749ef3f90c4bd7f (diff)
downloadvyos-cloud-init-c33ac7e2deecadeb7f34dacc4e91a3cad2c87ffd.tar.gz
vyos-cloud-init-c33ac7e2deecadeb7f34dacc4e91a3cad2c87ffd.zip
CloudSigma: encode/decode data before communicating over the serial channel
Diffstat (limited to 'cloudinit/cs_utils.py')
-rw-r--r--cloudinit/cs_utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/cs_utils.py b/cloudinit/cs_utils.py
index dcf56431..83ac1a0e 100644
--- a/cloudinit/cs_utils.py
+++ b/cloudinit/cs_utils.py
@@ -83,8 +83,8 @@ class CepkoResult(object):
connection = serial.Serial(port=SERIAL_PORT,
timeout=READ_TIMEOUT,
writeTimeout=WRITE_TIMEOUT)
- connection.write(self.request)
- return connection.readline().strip('\x04\n')
+ connection.write(self.request.encode('ascii'))
+ return connection.readline().strip(b'\x04\n').decode('ascii')
def _marshal(self, raw_result):
try: