This makes testing a bit easier, and is of course fine.

Signed-off-by: Ian Jackson <ian.jack...@eu.citrix.com>
---
 cr-ensure-disk-space | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space
index ff6b01b..bfdbcc5 100755
--- a/cr-ensure-disk-space
+++ b/cr-ensure-disk-space
@@ -72,9 +72,11 @@ check_space if check_space;
 
 print "taking lock...";
 
-my $lock = "$c{GlobalLockDir}/publish-lock";
-open LOCK, "> $lock" or die "$lock $!";
-flock LOCK, LOCK_EX or die $!;
+if (!$dryrun) {
+    my $lock = "$c{GlobalLockDir}/publish-lock";
+    open LOCK, "> $lock" or die "$lock $!";
+    flock LOCK, LOCK_EX or die $!;
+}
 
 print "proceeding...\n";
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to