From 89fe4242aa3d825ee1b439cc8d184ddf06382086 Mon Sep 17 00:00:00 2001 From: Robert Jennings Date: Thu, 28 Apr 2016 12:10:33 -0500 Subject: 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 --- cloudinit/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cloudinit') 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)) -- cgit v1.2.3