update_etc_hosts broken for all distros but ubuntu
Bug #1100036 reported by
Craig Tracey
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Craig Tracey |
Bug Description
Right now hosts templates are named:
- hosts.redhat.tmpl
- hosts.ubuntu.tmpl
As the code is written such that it calls:
tpl_fn_name = cloud.get_
This will only work for the 'ubuntu' distro.
Related branches
lp:~craigtracey/cloud-init/update-etc-hosts
- Joshua Harlow (community): Needs Fixing
-
Diff: 170 lines (+55/-30)8 files modifiedcloudinit/config/__init__.py (+3/-1)
cloudinit/config/cc_update_etc_hosts.py (+3/-2)
cloudinit/distros/__init__.py (+15/-0)
cloudinit/distros/debian.py (+1/-0)
cloudinit/distros/rhel.py (+1/-0)
cloudinit/stages.py (+7/-2)
templates/hosts.debian.tmpl (+25/-0)
templates/hosts.ubuntu.tmpl (+0/-25)
lp:~craigtracey/cloud-init/osfamilies
- Joshua Harlow (community): Approve
-
Diff: 92 lines (+27/-3)5 files modifiedcloudinit/config/__init__.py (+3/-1)
cloudinit/distros/__init__.py (+15/-0)
cloudinit/distros/debian.py (+1/-0)
cloudinit/distros/rhel.py (+1/-0)
cloudinit/stages.py (+7/-2)
Changed in cloud-init: | |
assignee: | nobody → Craig Tracey (craigtracey) |
To post a comment you must log in.
Hi, I am not sure if this is alrady addressed in the fix, but if you mark distro as "rhel" in /etc/cloud/ cloud.cfg:
[...]
system_info:
distro: rhel
[...]
and enable update_etc_hosts module (which is enabled by default), you get:
2013-01-24 16:15:37,362 - cloud.py[WARNING]: No template found at /etc/cloud/ templates/ hosts.rhel. tmpl for template named hosts.rhel config. cc_update_ etc_hosts' from '/usr/lib/ python2. 6/site- packages/ cloudinit/ config/ cc_update_ etc_hosts. pyc'>) failed
2013-01-24 16:15:37,362 - util.py[WARNING]: Running update_etc_hosts (<module 'cloudinit.
as there is no hosts.redhat.tmpl.
When I do templates/ hosts.redhat. tmpl /etc/cloud/ templates/ hosts.rhel. tmpl
ln -s /etc/cloud/
and re-run update_etc_hosts, then it works properly