From b55940dc66e561b2f186fba8202098d809070a1c Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 31 Aug 2012 11:58:21 +0200 Subject: [PATCH] run parted with the --script option to prevent from hanging also use more explicit --list option instead of -l --- source/steps/CheckForNewDisks.py | 2 +- source/systeminfo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/steps/CheckForNewDisks.py b/source/steps/CheckForNewDisks.py index 14523d8..09a001d 100644 --- a/source/steps/CheckForNewDisks.py +++ b/source/steps/CheckForNewDisks.py @@ -91,7 +91,7 @@ def Run( vars, log ): # just to be extra paranoid, ignore the device if it already has # an lvm partition on it (new disks won't have this, and that is # what this code is for, so it should be ok). - cmd = "parted -l %s | grep -q lvm$" % device + cmd = "parted --script --list %s | grep -q lvm$" % device has_lvm= utils.sysexec_noerr(cmd, log) if has_lvm: log.write( "It appears %s has lvm already setup on it.\n" % device) diff --git a/source/systeminfo.py b/source/systeminfo.py index 9754f5c..921ede6 100755 --- a/source/systeminfo.py +++ b/source/systeminfo.py @@ -157,7 +157,7 @@ def get_block_device_list(vars = {}, log = sys.stderr): devicenames = valid_blk_names.keys() devicenames.sort() for devicename in devicenames: - os.system( "parted -l /dev/%s > /dev/null 2>&1" % devicename ) + os.system( "parted --script --list /dev/%s > /dev/null 2>&1" % devicename ) # touch file fb = open(DEVICES_SCANNED_FLAG,"w") -- 2.43.0