summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jennings <robert.jennings@canonical.com>2016-04-28 12:10:33 -0500
committerRobert Jennings <robert.jennings@canonical.com>2016-04-28 12:10:33 -0500
commit89fe4242aa3d825ee1b439cc8d184ddf06382086 (patch)
treee6ecec2b0674e067d0aab6e6e10f1da6ae716b85
parent7b65c24f389471bbaa9aa38e164c6440b18f22f4 (diff)
downloadvyos-cloud-init-89fe4242aa3d825ee1b439cc8d184ddf06382086.tar.gz
vyos-cloud-init-89fe4242aa3d825ee1b439cc8d184ddf06382086.zip
Tweak instance path name based on review feedback
r1213 (Ensure instance path is a child of cloud_dir) stripped the leading path separator. This patch goes further by replacing all path seperators with '_' which will avoid a deep directory structure under /var/lib/cloud/instances. LP: #1575938
-rw-r--r--cloudinit/helpers.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/helpers.py b/cloudinit/helpers.py
index 24a3d5b5..e9fec628 100644
--- a/cloudinit/helpers.py
+++ b/cloudinit/helpers.py
@@ -375,7 +375,7 @@ class Paths(object):
def _get_ipath(self, name=None):
if not self.datasource:
return None
- iid = self.datasource.get_instance_id().lstrip(os.sep)
+ iid = self.datasource.get_instance_id().replace(os.sep, '_')
if iid is None:
return None
ipath = os.path.join(self.cloud_dir, 'instances', str(iid))