diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-10-01 15:58:30 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-10-01 15:58:30 -0400 |
commit | 5bb6a49f66c76d9accb912a5612c970a52f5b964 (patch) | |
tree | 6171c9f7eff77718337e4dd3723dc89dda5a393b /cloudinit/config/cc_mounts.py | |
parent | a451caaf7128f8415ec33ab9aebcad61243d2dc8 (diff) | |
download | vyos-cloud-init-5bb6a49f66c76d9accb912a5612c970a52f5b964.tar.gz vyos-cloud-init-5bb6a49f66c76d9accb912a5612c970a52f5b964.zip |
return only the filename, as it might be all known
Diffstat (limited to 'cloudinit/config/cc_mounts.py')
-rw-r--r-- | cloudinit/config/cc_mounts.py | 10 |
1 files 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.") |