Skip to content

Commit

Permalink
fix: normalize local variable name
Browse files Browse the repository at this point in the history
This commit normalizes the opensuse create_hostname_file variable to
match the other distros.
  • Loading branch information
catmsred committed Sep 5, 2023
1 parent ef5ff7d commit b2537b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cloudinit/distros/opensuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ def _set_update_method(self):
self.update_method = "zypper"

def _write_hostname(self, hostname, filename):
preserve_state = util.get_cfg_option_bool(
create_hostname_file = util.get_cfg_option_bool(
self._cfg, "create_hostname_file"
)
if self.uses_systemd() and filename.endswith("/previous-hostname"):
util.write_file(filename, hostname)
elif self.uses_systemd():
if not preserve_state:
if not create_hostname_file:
subp.subp(["hostnamectl", "set-hostname", str(hostname)])
else:
subp.subp(
Expand All @@ -245,7 +245,7 @@ def _write_hostname(self, hostname, filename):
# so lets see if we can read it first.
conf = self._read_hostname_conf(filename)
except IOError:
if not preserve_state:
if not create_hostname_file:
pass
else:
return
Expand Down

0 comments on commit b2537b5

Please sign in to comment.