summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-02-24 17:20:12 -0500
committerScott Moser <smoser@ubuntu.com>2014-02-24 17:20:12 -0500
commitda13f065c9a2be372fea35db62e51086d443f8dc (patch)
tree6984cf3c222cf2d132498b56271b6c97d4344c5d /cloudinit/util.py
parent2781fc8289e4aab130125b1a3e69b45a9318f805 (diff)
downloadvyos-cloud-init-da13f065c9a2be372fea35db62e51086d443f8dc.tar.gz
vyos-cloud-init-da13f065c9a2be372fea35db62e51086d443f8dc.zip
fixes from testing, force symlink
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 87b0c853..06039ee2 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -1395,8 +1395,10 @@ def get_builtin_cfg():
return obj_copy.deepcopy(CFG_BUILTIN)
-def sym_link(source, link):
+def sym_link(source, link, force=False):
LOG.debug("Creating symbolic link from %r => %r", link, source)
+ if force and os.path.exists(link):
+ del_file(link)
os.symlink(source, link)