]> xenbits.xensource.com Git - people/aperard/osstest.git/commitdiff
mg-hosts: mknetbootdir: Add a couple of error checks
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 30 Nov 2017 17:39:13 +0000 (17:39 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Tue, 5 Dec 2017 18:57:48 +0000 (18:57 +0000)
This will help us stop blundering on if something is wrong.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
mg-hosts

index d91a9657cb9aace52a7b598d9e3b5e7ae99187b8..e230e3834f5bb7e704c1bb0467a05bbb7ac5a822 100755 (executable)
--- a/mg-hosts
+++ b/mg-hosts
@@ -122,9 +122,11 @@ sub cmd_mknetbootdir () {
     foreach my $hn (@ARGV) {
         my $ho= selecthost("host=$hn");
        my ($dir, $file) = host_netboot_file($ho);
+        die unless defined $dir;
        my ($rdir, $realfile) = host_netboot_file($ho, 'TemplatesReal');
        $realfile //= $file;
        my $dirname = dirname $file;
+        die unless $dirname;
        my $cmd = <<END;
             set -e
            cd $dir