From 7b65c24f389471bbaa9aa38e164c6440b18f22f4 Mon Sep 17 00:00:00 2001 From: Robert Jennings Date: Wed, 27 Apr 2016 16:33:13 -0500 Subject: Ensure instance path is a child of cloud_dir A cloud has an instance-id metadata value in the form: /Compute-$TENANT/$CLOUDUSERNAME/$UUID The leading '/' causes /var/lib/cloud/instance to link to /Compute-$TENANT/$CLOUDUSERNAME/$UUID rather than /var/lib/cloud/instances/Compute-$TENANT/$CLOUDUSERNAME/$UUID This patch strips the leading path separator from the instance-id. 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 0cf982f3..24a3d5b5 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() + iid = self.datasource.get_instance_id().lstrip(os.sep) if iid is None: return None ipath = os.path.join(self.cloud_dir, 'instances', str(iid)) -- cgit v1.2.3