obmc-phosphor-discovery-service: Include hostname in service names
Currently, we'll export avahi services solely under their service names.
With multiple BMCs on a network, this ends up with multiple
indistinguisable services exposed over avahi:
[jk@pecola ~]$ avahi-browse _obmc_console._tcp
+ br0 IPv6 obmc_console _obmc_console._tcp local
+ br0 IPv4 obmc_console _obmc_console._tcp local
+ br0 IPv4 obmc_console #2 _obmc_console._tcp local
+ br0 IPv6 obmc_console #2 _obmc_console._tcp local
This change uses the hostname as the identifier instead. There's no need
to include the service name, as that's what the service type field is
for.
(From meta-phosphor rev: d4e212eeed5832685839e24cf9ec4207ea3f32ae)
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Change-Id: I6b18b60c28cf4f2699693d41c2d52d56cd87a26a
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-phosphor/classes/obmc-phosphor-discovery-service.bbclass b/meta-phosphor/classes/obmc-phosphor-discovery-service.bbclass
index e912bea..fdade60 100644
--- a/meta-phosphor/classes/obmc-phosphor-discovery-service.bbclass
+++ b/meta-phosphor/classes/obmc-phosphor-discovery-service.bbclass
@@ -72,7 +72,8 @@
fd.write('<?xml version="1.0" ?>\n')
fd.write('<!DOCTYPE service-group SYSTEM "avahi-service.dtd">\n')
fd.write('<service-group>\n')
- fd.write(' <name>%s</name>\n' % service_name)
+ fd.write(' <name replace-wildcards="yes">%s on %%h</name>\n'
+ % service_name)
fd.write(' <service>\n')
fd.write(' <type>%s</type>\n' % service_type)
fd.write(' <port>%s</port>\n' % service_port)