summaryrefslogtreecommitdiff
path: root/cloudinit/helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/helpers.py')
-rw-r--r--cloudinit/helpers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/helpers.py b/cloudinit/helpers.py
index 0cf982f3..7f00bf1f 100644
--- a/cloudinit/helpers.py
+++ b/cloudinit/helpers.py
@@ -378,7 +378,8 @@ class Paths(object):
iid = self.datasource.get_instance_id()
if iid is None:
return None
- ipath = os.path.join(self.cloud_dir, 'instances', str(iid))
+ path_safe_iid = str(iid).replace(os.sep, '_')
+ ipath = os.path.join(self.cloud_dir, 'instances', path_safe_iid)
add_on = self.lookups.get(name)
if add_on:
ipath = os.path.join(ipath, add_on)