From patchwork Fri Jan 20 12:19:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 9528151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5EB8260459 for ; Fri, 20 Jan 2017 12:23:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5073028560 for ; Fri, 20 Jan 2017 12:23:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44F3628616; Fri, 20 Jan 2017 12:23:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 00AE328560 for ; Fri, 20 Jan 2017 12:23:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUYBk-0000q2-7b; Fri, 20 Jan 2017 12:21:04 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUYBj-0000oR-B3 for xen-devel@lists.xenproject.org; Fri, 20 Jan 2017 12:21:03 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id 48/AD-02804-EA002885; Fri, 20 Jan 2017 12:21:02 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkkeJIrShJLcpLzFFi42JxWrrBXncNQ1O EwedN1hbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8aLlVNZC/p4Kxqun2RvYLzF1cXIySEh4C+x YeN8RhCbTUBXomnLX7YuRg4OEQEVidt7DUBMZoFQiR0vLEEqhAUCJGZtewlWzSKgKtHwqJsJp IRXwEtic6sHxEA5ifPHfzKD2JxA4Q2d28BsIQFPicY/PxlByoUE1CTmro8HCfMKCEqcnPmEBc RmFpCQOPjiBfMERt5ZSFKzkKQWMDKtYtQoTi0qSy3SNTTSSyrKTM8oyU3MzNE1NDDWy00tLk5 MT81JTCrWS87P3cQIDBoGINjB+Krb+RCjJAeTkijv7o8NEUJ8SfkplRmJxRnxRaU5qcWHGGU4 OJQkeCv+N0YICRalpqdWpGXmAMMXJi3BwaMkwtsPkuYtLkjMLc5Mh0idYlSUEue9CZIQAElkl ObBtcFi5hKjrJQwLyPQIUI8BalFuZklqPKvGMU5GJWEeQ+ATOHJzCuBm/4KaDET0GIr5XqQxS WJCCmpBkZeP4FdW5esXG+xKZ79RZqseHDhWTFVBQOp7OZ3YZfNOFPbTknzeB3Tu+l2csojsc/ 8Rw+/s5woduMT69nqh04mH+2ST0z4//Ba6PNH7R+u9FnsZF0sfryjh6X+m8i+/yV/TPP9n50s eDHzVWTvWt5pnG9OHpvN5qR++tx+030fHeWO1lhZhR1QYinOSDTUYi4qTgQAPe7aBJQCAAA= X-Env-Sender: prvs=18694997c=Ian.Jackson@citrix.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1484914855!64775818!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18016 invoked from network); 20 Jan 2017 12:21:00 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-12.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 20 Jan 2017 12:21:00 -0000 X-IronPort-AV: E=Sophos;i="5.33,258,1477958400"; d="scan'208";a="409819272" From: Ian Jackson To: Date: Fri, 20 Jan 2017 12:19:04 +0000 Message-ID: <1484914764-20861-16-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1484914764-20861-1-git-send-email-ian.jackson@eu.citrix.com> References: <1484914764-20861-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Cc: Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH 15/35] pxe templates: Do defaulting outside host_pxefile X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP host_pxefile now returns undef if the specified $templatekey is not configured, rather than defaulting to the plain PxeTemplates. This is going to useful because we want host_pxefile not to hardcode the default: with netgrub, the settings are all different. If $templatekey is 'PxeTemplates' then this only has any effect if the PxeTempltes is not defined - ie, a broken case. There is one place where $templatekey is not 'PxeTemplates', in mg-hosts. The defaulting to the value of PxeTemplates now occurs there. So, overall, no functional change in non-broken cases. Signed-off-by: Ian Jackson --- Osstest/TestSupport.pm | 3 ++- mg-hosts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 888f0ac..4c6a677 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -2370,7 +2370,8 @@ sub host_pxefile ($;$) { my ($ho, $templatekey) = @_; my %v = %r; $templatekey //= 'PxeTemplates'; - my $templates = $ho->{Tftp}{$templatekey} || $ho->{Tftp}{PxeTemplates}; + my $templates = $ho->{Tftp}{$templatekey}; + return undef unless defined $templates; if (defined $ho->{Ether}) { my $eth = $v{'ether'} = $ho->{Ether}; $eth =~ y/A-Z/a-z/; diff --git a/mg-hosts b/mg-hosts index f785454..ed51952 100755 --- a/mg-hosts +++ b/mg-hosts @@ -120,6 +120,7 @@ sub cmd_mkpxedir () { my $ho= selecthost("host=$hn"); my $pxefile = host_pxefile($ho); my $pxerealfile = host_pxefile($ho, 'PxeTemplatesReal'); + $pxerealfile //= $pxefile; my $dirname = dirname $pxefile; my $cmd = <