summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorWesley Wiedenmeier <wesley.wiedenmeier@gmail.com>2016-03-21 21:10:20 -0500
committerWesley Wiedenmeier <wesley.wiedenmeier@gmail.com>2016-03-21 21:10:20 -0500
commit9a146e83189ef3128a04c9e0c1d21c6181f554f1 (patch)
tree3ef35dc7e6d2ddb450ee3037308284df052d1488 /cloudinit/util.py
parentbb58463474e334b8c8d1769101bd3afc48ebfef4 (diff)
downloadvyos-cloud-init-9a146e83189ef3128a04c9e0c1d21c6181f554f1.tar.gz
vyos-cloud-init-9a146e83189ef3128a04c9e0c1d21c6181f554f1.zip
Added _write_network_fallback function to distros.debian and abstract to
distros base, and apply_fallback_network to distros to call _write_network_fallback. Note that since _write_network_fallback is only implemented for debian and ubuntu a check is needed to ensure that it does not break behaviour for other distros. Added function to disable .cfg files to util, since it may be useful elsewhere
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 20916e53..fa3a6163 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -849,6 +849,15 @@ def read_seeded(base="", ext="", timeout=5, retries=10, file_retries=0):
return (md, ud)
+def disable_conf_file(conf):
+ # disable .cfg file by renaming it if it exists
+ if not os.path.exists(conf):
+ return None
+ target_path = os.path.join(conf, '.disabled')
+ rename(conf, target_path)
+ return target_path
+
+
def read_conf_d(confd):
# Get reverse sorted list (later trumps newer)
confs = sorted(os.listdir(confd), reverse=True)