summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_set_hostname.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/config/cc_set_hostname.py')
-rw-r--r--cloudinit/config/cc_set_hostname.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/config/cc_set_hostname.py b/cloudinit/config/cc_set_hostname.py
index c13020d8..1d23d80d 100644
--- a/cloudinit/config/cc_set_hostname.py
+++ b/cloudinit/config/cc_set_hostname.py
@@ -85,7 +85,7 @@ def handle(name, cfg, cloud, log, _args):
except Exception as e:
msg = "Failed to set the hostname to %s (%s)" % (fqdn, hostname)
util.logexc(log, msg)
- raise SetHostnameError("%s: %s" % (msg, e))
+ raise SetHostnameError("%s: %s" % (msg, e)) from e
write_json(prev_fn, {'hostname': hostname, 'fqdn': fqdn})
# vi: ts=4 expandtab