summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_mounts.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/config/cc_mounts.py')
-rw-r--r--cloudinit/config/cc_mounts.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py
index 54f2f878..c22d1698 100644
--- a/cloudinit/config/cc_mounts.py
+++ b/cloudinit/config/cc_mounts.py
@@ -255,8 +255,9 @@ def create_swapfile(fname: str, size: str) -> None:
try:
subp.subp(cmd, capture=True)
except subp.ProcessExecutionError as e:
- LOG.warning(errmsg, fname, size, method, e)
+ LOG.info(errmsg, fname, size, method, e)
util.del_file(fname)
+ raise
swap_dir = os.path.dirname(fname)
util.ensure_dir(swap_dir)
@@ -269,9 +270,8 @@ def create_swapfile(fname: str, size: str) -> None:
else:
try:
create_swap(fname, size, "fallocate")
- except subp.ProcessExecutionError as e:
- LOG.warning(errmsg, fname, size, "dd", e)
- LOG.warning("Will attempt with dd.")
+ except subp.ProcessExecutionError:
+ LOG.info("fallocate swap creation failed, will attempt with dd")
create_swap(fname, size, "dd")
if os.path.exists(fname):