diff options
author | Mark Mielke <mark.mielke@gmail.com> | 2023-01-18 11:18:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-18 10:18:55 -0600 |
commit | 3abdae4adcc8715a1ee2059c4a96ae916273fcf6 (patch) | |
tree | f5954fcf24211fe7f1beb0c0cd4005c3bd1e0989 | |
parent | 0c3dd0ffd0ac6d44e841fb2fa9a630f19b4f7a79 (diff) | |
download | cloud-init-git-3abdae4adcc8715a1ee2059c4a96ae916273fcf6.tar.gz |
distros/rhel.py: _read_hostname() missing strip on "hostname" (#1941)
Debugging a related issue, I found that the determination of the
"previous-hostname" was wrong on RHEL-based distributions.
The fix is to add a call to strip on the result of the call to
command "hostname" the same way the strip is done on the file
containing the "previous-hostname".
-rw-r--r-- | cloudinit/distros/rhel.py | 1 | ||||
-rw-r--r-- | tools/.github-cla-signers | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/cloudinit/distros/rhel.py b/cloudinit/distros/rhel.py index 320f4ba1..df7dc3d6 100644 --- a/cloudinit/distros/rhel.py +++ b/cloudinit/distros/rhel.py @@ -132,6 +132,7 @@ class Distro(distros.Distro): return util.load_file(filename).strip() elif self.uses_systemd(): (out, _err) = subp.subp(["hostname"]) + out = out.strip() if len(out): return out else: diff --git a/tools/.github-cla-signers b/tools/.github-cla-signers index c61f1e24..77962d87 100644 --- a/tools/.github-cla-signers +++ b/tools/.github-cla-signers @@ -76,6 +76,7 @@ mal ManassehZhou mamercad manuelisimo +MarkMielke marlluslustosa matthewruffell maxnet |