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
This commit is contained in:
Sean Mooney 2020-03-25 15:12:54 +00:00
parent 31d23b7315
commit ec0eab0ffb
1 changed files with 1 additions and 1 deletions

View File

@ -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, '