From 81d03ab87cfabb5b9d8c7ae1a19bb7f3ff2338ac Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Sun, 17 Jan 2016 14:29:11 +0000 Subject: runtime python3 changes --- bin/vmdebootstrap | 2 +- vmdebootstrap/filesystem.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/vmdebootstrap b/bin/vmdebootstrap index dc76693..169da37 100755 --- a/bin/vmdebootstrap +++ b/bin/vmdebootstrap @@ -63,7 +63,7 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth def add_settings(self): # deliberately long lines for clarity. - default_arch = subprocess.check_output(["dpkg", "--print-architecture"]).strip() + default_arch = subprocess.check_output(["dpkg", "--print-architecture"]).decode('utf-8').strip() self.settings.boolean(['verbose'], 'report what is going on') self.settings.string(['image'], 'put created disk image in FILE', metavar='FILE') diff --git a/vmdebootstrap/filesystem.py b/vmdebootstrap/filesystem.py index 8a4dc2a..d17663e 100644 --- a/vmdebootstrap/filesystem.py +++ b/vmdebootstrap/filesystem.py @@ -115,9 +115,9 @@ class Filesystem(Base): parts = 1 boot = None swap = None - devices = [line.split()[2] + devices = [line.decode('utf-8').split()[2] for line in out.splitlines() - if line.startswith('add map ')] + if line.decode('utf-8').startswith('add map ')] if len(devices) != parts: msg = 'Surprising number of partitions - check output of losetup -a' logging.debug("%s", runcmd(['losetup', '-a'])) @@ -125,7 +125,7 @@ class Filesystem(Base): raise cliapp.AppException(msg) root = '/dev/mapper/%s' % devices[rootindex] if self.settings['bootsize'] or self.settings['use-uefi']: - boot = '/dev/mapper/%s' % devices[bootindex] + boot = '/dev/mapper/%s' % devices[bootindex].decode('utf-8') if self.settings['swap'] > 0: swap = '/dev/mapper/%s' % devices[swapindex] self.devices['rootdev'] = root -- cgit v1.2.1