Cloud-init inject hostname should support dot and without .novalocal

Bug #1786744 reported by Sibiao Luo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Undecided
Unassigned

Bug Description

Description of problem:
Cloud-init inject hostname should support dot and without .novalocal.

Version-Release number of selected component (if applicable):
cloud-init 0.7.9

How reproducible:
100%

Steps to Reproduce:
1.create a RHEL7.5/7.4 instance specified the hostname with OpenStack API
2.login VM with hostnamectl to check the hostname

Actual results:
API: hostname=ecs-rhel7.4-instance --------> VM: hostname=ecs-rhel7.novanoval
API: hostname=ecs-rhel74-instance --------> VM: ecs-rhel74-instance.novanoval

Expected results:
The VM hostname is the same as specified in OpenStack API or ECS Console.

Additional info:
# diff __init__.py
usr/lib/python2.7/site-packages/cloudinit/sources/__init__.py
205c205
< toks = lhost.split(".novalocal")
---
> toks = lhost.split(".")
209c209
< #domain = '.'.join(toks[1:])
---
> domain = '.'.join(toks[1:])

Sibiao Luo (sibiaoluo)
Changed in cloud-init:
assignee: nobody → Sibiao Luo (sibiaoluo)
assignee: Sibiao Luo (sibiaoluo) → nobody
Revision history for this message
Scott Moser (smoser) wrote :

Hi,
Could you please test to see if this is still a problem with trunk?

We have daily copr builds at
 https://copr.fedorainfracloud.org/coprs/g/cloud-init/cloud-init-dev/

Please test with the builds there and report back.

If it is still a problem, please attach the output of 'cloud-init collect-logs'.

After you've done so, please set the status to 'Confirmed'.

Thanks.

Changed in cloud-init:
status: New → Incomplete
Revision history for this message
Sibiao Luo (sibiaoluo) wrote :

Try this:
https://copr-be.cloud.fedoraproject.org/results/%40cloud-init/cloud-init-dev/epel-7-x86_64/00788016-cloud-init/cloud-init-18.3+24.gf6249277-1.el7.noarch.rpm

It support donot now, but still append the .novalocal problem.

You shoud split it by .novalocal which can make success.

# diff __init__.py
usr/lib/python2.7/site-packages/cloudinit/sources/__init__.py
205c205
< toks = lhost.split(".novalocal")
---
> toks = lhost.split(".")
209c209
< #domain = '.'.join(toks[1:])
---
> domain = '.'.join(toks[1:])

Revision history for this message
Sibiao Luo (sibiaoluo) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

Hi,
can you please attach the output of 'cloud-init collect-logs'.

Thank you.
Scott

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for cloud-init because there has been no activity for 60 days.]

Changed in cloud-init:
status: Incomplete → Expired
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.