From 55ebe9480253cef01c3c092a50659bf70f9abc2a Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Thu, 28 Aug 2014 10:53:32 -0700 Subject: [PATCH] Use simple subprocess call for default_arch to prevent early use of run_cmd causing problems with log output --- vmdebootstrap | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vmdebootstrap b/vmdebootstrap index 5467429..89739c5 100755 --- a/vmdebootstrap +++ b/vmdebootstrap @@ -20,7 +20,6 @@ import crypt import logging import os import re -import time import shutil import subprocess import tempfile @@ -33,9 +32,8 @@ __version__ = '0.3' class VmDebootstrap(cliapp.Application): def add_settings(self): - default_arch = self.runcmd( - ["dpkg", "--print-architecture"], - ignore_fail=False).strip() + default_arch = subprocess.check_output( + ["dpkg", "--print-architecture"]).strip() self.settings.boolean(['verbose'], 'report what is going on') self.settings.string(['image'], 'put created disk image in FILE', @@ -319,6 +317,7 @@ class VmDebootstrap(cliapp.Application): self.runcmd(args) if self.settings['foreign']: # First copy the binfmt handler over + self.message('Setting up binfmt handler') shutil.copy(self.settings['foreign'], '%s/usr/bin/' % rootdir) # Next, run the package install scripts etc. self.message('Running debootstrap second stage') -- 2.39.5