From: Ian Jackson Date: Mon, 4 Oct 2021 16:44:13 +0000 (+0100) Subject: mg-allocate: Break out sub precheck (nfc) X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7fa3803d6a024d94e30aa4d661d1846f6aa9c6f1;p=osstest.git mg-allocate: Break out sub precheck (nfc) Signed-off-by: Ian Jackson --- diff --git a/mg-allocate b/mg-allocate index 14c46e0..8eca59e 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();