]> xenbits.xensource.com Git - osstest.git/commitdiff
mg-allocate: Break out sub precheck (nfc)
authorIan Jackson <iwj@xenproject.org>
Mon, 4 Oct 2021 16:44:13 +0000 (17:44 +0100)
committerIan Jackson <iwj@xenproject.org>
Mon, 4 Oct 2021 16:44:40 +0000 (17:44 +0100)
Signed-off-by: Ian Jackson <iwj@xenproject.org>
mg-allocate

index 14c46e0ccbc66d55a18d7a0187254decb92f83c4..8eca59e2c5e95a6330ed34f1a5d135aac0a41727 100755 (executable)
@@ -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();