diff options
author | Daniel Watkins <daniel.watkins@canonical.com> | 2015-03-13 10:18:12 +0000 |
---|---|---|
committer | Daniel Watkins <daniel.watkins@canonical.com> | 2015-03-13 10:18:12 +0000 |
commit | c8a7b446de26c6bc19df1b8bb7d2b39cb9487749 (patch) | |
tree | 98db90c83bb72526278537a4d49a0182a598fde2 /cloudinit/sources | |
parent | 31a8aab92656279b141a9c29e484c4895bde15d3 (diff) | |
download | vyos-cloud-init-c8a7b446de26c6bc19df1b8bb7d2b39cb9487749.tar.gz vyos-cloud-init-c8a7b446de26c6bc19df1b8bb7d2b39cb9487749.zip |
Write and read bytes to/from the SmartOS serial console.
Diffstat (limited to 'cloudinit/sources')
-rw-r--r-- | cloudinit/sources/DataSourceSmartOS.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/sources/DataSourceSmartOS.py b/cloudinit/sources/DataSourceSmartOS.py index 9d48beab..896fde3f 100644 --- a/cloudinit/sources/DataSourceSmartOS.py +++ b/cloudinit/sources/DataSourceSmartOS.py @@ -319,7 +319,8 @@ def query_data(noun, seed_device, seed_timeout, strip=False, default=None, return False ser = get_serial(seed_device, seed_timeout) - ser.write("GET %s\n" % noun.rstrip()) + request_line = "GET %s\n" % noun.rstrip() + ser.write(request_line.encode('ascii')) status = str(ser.readline()).rstrip() response = [] eom_found = False @@ -329,7 +330,7 @@ def query_data(noun, seed_device, seed_timeout, strip=False, default=None, return default while not eom_found: - m = ser.readline() + m = ser.readline().decode('ascii') if m.rstrip() == ".": eom_found = True else: |