From 5bb6a49f66c76d9accb912a5612c970a52f5b964 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 1 Oct 2014 15:58:30 -0400 Subject: return only the filename, as it might be all known --- cloudinit/config/cc_mounts.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py index e0d047d6..1cb1e839 100644 --- a/cloudinit/config/cc_mounts.py +++ b/cloudinit/config/cc_mounts.py @@ -181,7 +181,7 @@ def setup_swapfile(fname, size=None, maxsize=None): except Exception as e: raise IOError("Failed %s: %s" % (msg, e)) - return fname, size + return fname def handle_swapcfg(swapcfg): @@ -204,16 +204,16 @@ def handle_swapcfg(swapcfg): if not os.path.exists("/proc/swaps"): LOG.debug("swap file %s existed. no /proc/swaps. Being safe.", fname) - return + return fname try: for line in util.load_file("/proc/swaps").splitlines(): if line.startswith(fname + " "): LOG.debug("swap file %s already in use.", fname) - return + return fname LOG.debug("swap file %s existed, but not in /proc/swaps", fname) except: LOG.warn("swap file %s existed. Error reading /proc/swaps", fname) - return + return fname try: if isinstance(size, str) and size != "auto": @@ -317,7 +317,7 @@ def handle(_name, cfg, cloud, log, _args): swapret = handle_swapcfg(cfg.get('swap', {})) if swapret: - actlist.append([swapret[0], "none", "swap", "sw", "0", "0"]) + actlist.append([swapret, "none", "swap", "sw", "0", "0"]) if len(actlist) == 0: log.debug("No modifications to fstab needed.") -- cgit v1.2.3