diff mbox series

[OSSTEST,3/6] mg-allocate: Break out sub precheck (nfc)

Message ID 20211004170654.21864-4-iwj@xenproject.org (mailing list archive)
State New, archived
Headers show
Series allocation / test fixes | expand

Commit Message

Ian Jackson Oct. 4, 2021, 5:06 p.m. UTC
Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 mg-allocate | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/mg-allocate b/mg-allocate
index 14c46e0cc..8eca59e2c 100755
--- a/mg-allocate
+++ b/mg-allocate
@@ -647,14 +647,16 @@  if (defined $donate_spec) {
 	if grep { m/^!/ } @ARGV;
 }
 
+sub precheck () {
+    logm("pre-checking resources (dry run)...");
+    local $Osstest::TestSupport::logm_prefix = $logm_prefix.' (precheck)';
+    execute(1);
+}
+
 if ($duration) {
     die "--donate and --steal are incompatible with the planning system\n"
-	if @steal_specs || defined $donate_spec;
-    {
-	logm("pre-checking resources (dry run)...");
-	local $Osstest::TestSupport::logm_prefix = $logm_prefix.' (precheck)';
-	execute(1);
-    };
+        if @steal_specs || defined $donate_spec;
+    precheck();
     plan();
 } else {
     execute();