From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH OSSTEST RFC] Osstest/Debian.pm: Use Fqdn hostprop when collecting host keys Date: Fri, 1 May 2015 14:59:49 +0100 Message-ID: <1430488789.15640.39.camel@citrix.com> References: <1430487758-21972-1-git-send-email-ian.campbell@citrix.com> <21827.34001.74893.628888@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21827.34001.74893.628888@mariner.uk.xensource.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: Ian Jackson Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, 2015-05-01 at 14:51 +0100, Ian Jackson wrote: > Ian Campbell writes ("[PATCH OSSTEST RFC] Osstest/Debian.pm: Use Fqdn hostprop when collecting host keys"): > > Otherwise hosts which are not in the same DnsDomain are not processed, > > resulting in log messages such as: > > > > 2015-05-01 10:06:19 Z skipping host key for nonexistent host marilith-n4.xs.citrite.net > > 2015-05-01 10:06:20 Z skipping host key for nonexistent host lace-bug.xs.citrite.net > > Oops. > > > $hostsq->execute($flight); > > while (my ($node) = $hostsq->fetchrow_array()) { > > - my $longname= "$node.$c{TestHostDomain}"; > > + my %props; > > + $mhostdb->get_properties($node, \%props); > > + my $longname= $props{Fqdn} ? $props{Fqdn} : "$node.$c{TestHostDomain}"; > > Acked-by: Ian Jackson > > Although, there is very similar logic in selecthost() (see near > $defaultfqdn). The code here in preseed_create lacks the check to see > whether the hostname is the fqdn to start with. That code is: my $defaultfqdn = $name; $defaultfqdn .= ".$c{TestHostDomain}" unless $defaultfqdn =~ m/\./; $ho->{Fqdn} = get_host_property($ho,'fqdn',$defaultfqdn); Perhaps for now I should write: my $defaultfqdn = $node; $defaultfqdn .= ".$c{TestHostDomain}" unless $defaultfqdn =~ m/\./; my %props; $mhostdb->get_properties($node, \%props); my $longname= $props{Fqdn} ? $props{Fqdn} : $defaultfqdn; ? > Merging these two may > be a bit awkward (and involve more code than just duplicating the > logic), given their different environments, Mainly becuase here in preseed_create we lack a $ho object I think. > so I won't block your fixup for this. Thanks. Ian.