From a0de4ca256e7ced9684bd41c91d89442e71d391a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 19 Aug 2014 11:31:17 +0100 Subject: [PATCH] Fix mg-hosts mkpxedir * Have selecthost no longer demand that $job is set; if it is not, simply do not set Suite (which of course ultimately comes from runvars and hence the job). * Add missing use Osstest::TestSupport. * Mention the need to run it in README.dev. Signed-off-by: Ian Jackson --- Osstest/TestSupport.pm | 5 ++++- README.dev | 2 ++ mg-hosts | 9 +++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index fea54d5..1d77933 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -751,8 +751,11 @@ sub selecthost ($) { Name => $name, TcpCheckPort => 22, Info => [], - Suite => get_runvar_default("${ident}_suite",$job,$c{DebianSuite}), }; + if (defined $job) { + $ho->{Suite} = get_runvar_default("${ident}_suite",$job, + $c{DebianSuite}); + } #----- calculation of the host's properties ----- diff --git a/README.dev b/README.dev index d99c5c7..eb72659 100644 --- a/README.dev +++ b/README.dev @@ -42,6 +42,8 @@ $ mg-hosts setprops marilith-n4 -- dhcp-watch-method 'leases dhcp3 dns-cam1.uk.x Handles multiple hosts: $ mg-hosts setprops HOSTA HOSTB -- "PROP" "VALUE" +$ mg-hosts mkpxedir HOSTA HOSTB + Create a flight: $ FLIGHT=`OSSTEST_CONFIG=production-config ./cs-flight-create commission xen-unstable` $ echo $FLIGHT diff --git a/mg-hosts b/mg-hosts index c9d31df..2643548 100755 --- a/mg-hosts +++ b/mg-hosts @@ -85,6 +85,7 @@ use strict qw(vars refs); use DBI; use Osstest; +use Osstest::TestSupport; csreadconfig(); @@ -110,10 +111,10 @@ sub cmd_mkpxedir () { system_checked(<{Tftp}{Path}$ho->{Tftp}{PxeDir} - sudo chown root.$ho->{Tftp}{PxeGroup} $macdir - sudo chmod 2775 $macdir - sudo rm -f $hn - sudo ln -s $macdir $hn + $sudo chown root.$ho->{Tftp}{PxeGroup} $macdir + $sudo chmod 2775 $macdir + $sudo rm -f $hn + $sudo ln -s $macdir $hn ls -ald $hn $macdir END } -- 2.39.5