From: Neil Williams Date: Thu, 28 Aug 2014 17:53:32 +0000 (-0700) Subject: Use simple subprocess call for default_arch to prevent early use of run_cmd causing... X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=55ebe9480253cef01c3c092a50659bf70f9abc2a;p=forks%2Fvmdebootstrap.git Use simple subprocess call for default_arch to prevent early use of run_cmd causing problems with log output --- 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')