From 69124f104991e36e254c0be4a5f8155609f1d3fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Tue, 27 Jul 2010 13:15:01 -0400 Subject: [PATCH] ... cmd = "pvdisplay %s | grep -q 'planetlab'" % lvm_partition already_added= utils.sysexec_noerr(cmd, log) if already_added: log.write( "It appears %s is part of the volume group, continuing.\n" % device ) .... fails because pvdisplay returns a non-negative number on error [root@mlab1 ~]# pvdisplay /dev/sdb1 Failed to read physical volume "/dev/sdb1" [root@mlab1 ~]# echo $? 5 --- source/steps/CheckForNewDisks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/steps/CheckForNewDisks.py b/source/steps/CheckForNewDisks.py index eedc5bb..072feab 100644 --- a/source/steps/CheckForNewDisks.py +++ b/source/steps/CheckForNewDisks.py @@ -86,7 +86,7 @@ def Run( vars, log ): cmd = "pvdisplay %s | grep -q 'planetlab'" % lvm_partition already_added= utils.sysexec_noerr(cmd, log) - if already_added: + if already_added == 0: log.write( "It appears %s is part of the volume group, continuing.\n" % device ) continue -- 2.43.0