From: Ian Jackson Subject: Re: [PATCH OSSTEST v2 06/11] Cope with Jessie's d-i vg name Date: Mon, 15 Jun 2015 17:19:08 +0100 Message-ID: <21886.64252.978149.424708@mariner.uk.xensource.com> References: <1434375399-19107-1-git-send-email-wei.liu2@citrix.com> <1434375399-19107-7-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z4XyT-0005UN-Gy for xen-devel@lists.xenproject.org; Mon, 15 Jun 2015 17:15:05 +0000 In-Reply-To: <1434375399-19107-7-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: Xen-devel , ian.jackson@eu.citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org Wei Liu writes ("[PATCH OSSTEST v2 06/11] Cope with Jessie's d-i vg name"): > In Jessie the default vg name is changed to "$hostname-vg". Make that > default case and check for wheezy, squeeze and lenny for backward > compatibility. ... > - our $vgname= $ho->{Name}; > + our $vgname= $ho->{Suite} =~ m/wheezy|squeeze/ > + ? $ho->{Name} > + : $ho->{Suite} =~ m/lenny/ > + ? "$ho->{Name}.$c{TestHostDomain}" > + : "$ho->{Name}-vg"; This nested indentation is not conventional (in any language, AFAICT) for sequences of ? :. There are various acceptable indentations but I don't think this is one of them. (I normally prefer versions which put the condition and the result on the same line, but that may be too tedious here.) > sub determine_vg_lv () { > $vg= > - $ho->{Suite} =~ m/lenny/ > - ? "$ho->{Name}.$c{TestHostDomain}" > - : $ho->{Name}; > + $ho->{Suite} =~ m/wheezy|squeeze/ > + ? $ho->{Name} > + : $ho->{Suite} =~ m/lenny/ > + ? "$ho->{Name}.$c{TestHostDomain}" > + : "$ho->{Name}-vg"; Now, admittedly, this logic was duplicated before you started. But really I think you should abolish the duplication before extending it. Thanks, Ian.