summaryrefslogtreecommitdiff
path: root/cloudinit/distros/opensuse.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/distros/opensuse.py')
-rw-r--r--cloudinit/distros/opensuse.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/cloudinit/distros/opensuse.py b/cloudinit/distros/opensuse.py
index b4193ac2..2a7497cc 100644
--- a/cloudinit/distros/opensuse.py
+++ b/cloudinit/distros/opensuse.py
@@ -150,9 +150,9 @@ class Distro(distros.Distro):
host_fn = self.hostname_conf_fn
return (host_fn, self._read_hostname(host_fn))
- def _write_hostname(self, hostname, out_fn):
- if self.uses_systemd() and out_fn.endswith('/previous-hostname'):
- util.write_file(out_fn, hostname)
+ def _write_hostname(self, hostname, filename):
+ if self.uses_systemd() and filename.endswith('/previous-hostname'):
+ util.write_file(filename, hostname)
elif self.uses_systemd():
subp.subp(['hostnamectl', 'set-hostname', str(hostname)])
else:
@@ -160,13 +160,13 @@ class Distro(distros.Distro):
try:
# Try to update the previous one
# so lets see if we can read it first.
- conf = self._read_hostname_conf(out_fn)
+ conf = self._read_hostname_conf(filename)
except IOError:
pass
if not conf:
conf = HostnameConf('')
conf.set_hostname(hostname)
- util.write_file(out_fn, str(conf), 0o644)
+ util.write_file(filename, str(conf), 0o644)
@property
def preferred_ntp_clients(self):