diff options
-rwxr-xr-x | bin/vmdebootstrap | 2 | ||||
-rw-r--r-- | 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 |