summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-03-04 14:35:09 -0500
committerScott Moser <smoser@ubuntu.com>2014-03-04 14:35:09 -0500
commita9c7562ff3be9c552d757f24cfa61ef8985fe2e2 (patch)
treeecdcf5232c9b5d2d0d0145cf1ce5ea3d7170d567 /cloudinit/util.py
parentd7b79b1c5703a9fc4d533d15efa5fdb1f4f8352b (diff)
parent5c95d6817a4aea17054addceef5d955c75390aa1 (diff)
downloadvyos-cloud-init-a9c7562ff3be9c552d757f24cfa61ef8985fe2e2.tar.gz
vyos-cloud-init-a9c7562ff3be9c552d757f24cfa61ef8985fe2e2.zip
merge from trunk
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)