From ec0eab0ffb4fc18574dbd937f29545832d317e4c Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Wed, 25 Mar 2020 15:12:54 +0000 Subject: [PATCH] default host to socket.gethostname() As disucssed in november cyborg does not defualt its host paramater to the same value as nova. http://lists.openstack.org/pipermail/openstack-discuss/2019-November/011044.html This change updates the default value to match novas. On a host that does not have a fqdn set via dhcp and a corresponding dns record getfqdn() and gethostname() will return differnet values. This can also be seen in the differece in the hostname command output. [stack@cyborg-2 ~] hostname cyborg-2 [stack@cyborg-2 ~] hostname --fqdn localhost as a result on a host without an fqdn set in /etc/hostname or an fqdn set via dhcp/dns using socket.getfqdn() will result in 'localhost.localdomain' where as socket.gethostname() will result in 'cyborg-2' This is required to have the correct default behavior so that cyborg and discover and the parent placment resouce provider corresponding to the current host. Change-Id: I1687043dc2469343878cfeb466703eb9d4099ad0 --- cyborg/conf/default.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyborg/conf/default.py b/cyborg/conf/default.py index 4f3721ef..09788afd 100644 --- a/cyborg/conf/default.py +++ b/cyborg/conf/default.py @@ -34,7 +34,7 @@ exc_log_opts = [ service_opts = [ cfg.HostAddressOpt('host', - default=socket.getfqdn(), + default=socket.gethostname(), sample_default='localhost', help=_('Name of this node. This can be an opaque ' 'identifier. It is not necessarily a hostname, '