cloud-init strips ending newline from "/var/lib/cloud/data/previous-hostname"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
Steps to Reproduce:
1. enable cloud-init for rhel8
Actual results:
[root@mj-rhel87 ~]# cat /etc/hostname
mj-rhel87
[root@mj-rhel87 ~]# cat /var/lib/
mj-rhel87[
2023-03-28 14:47:45,733 - util.py[DEBUG]: Reading from /var/lib/
2023-03-28 14:47:45,734 - util.py[DEBUG]: Read 9 bytes from /var/lib/
2023-03-28 14:47:45,734 - subp.py[DEBUG]: Running command ['hostname'] with allowed return codes [0] (shell=False, capture=True)
2023-03-28 14:47:45,738 - __init__.py[INFO]: /var/lib/
Expected results:
file /var/lib/
The issue is seen on RHEl 7, RHEL 8 and RHEL 9.
Ubuntu doesn't have this problem.
-------------
ubuntu@
xiachen-test-ubuntu
ubuntu@
xiachen-test-ubuntu
ubuntu@
Posted a PR: https:/ /github. com/canonical/ cloud-init/ pull/2108