aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/ContainerUtils.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python/ContainerUtils.py')
-rw-r--r--resources/libraries/python/ContainerUtils.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/resources/libraries/python/ContainerUtils.py b/resources/libraries/python/ContainerUtils.py
index cd48fc6c1f..6fea804443 100644
--- a/resources/libraries/python/ContainerUtils.py
+++ b/resources/libraries/python/ContainerUtils.py
@@ -635,13 +635,16 @@ class LXC(ContainerEngine):
if self.container.mnt:
for mount in self.container.mnt:
host_dir, guest_dir = mount.split(':')
+ if host_dir.endswith('/'):
+ self.container.ssh.exec_command_sudo(
+ "sh -c 'mkdir -p {host_dir}'".format(host_dir=host_dir))
options = 'bind,create=dir' \
if guest_dir.endswith('/') else 'bind,create=file'
entry = 'lxc.mount.entry = {host_dir} '\
- '/var/lib/lxc/{c.name}/rootfs{guest_dir} none ' \
+ '{guest_dir} none ' \
'{options} 0 0'.format(c=self.container,
host_dir=host_dir,
- guest_dir=guest_dir,
+ guest_dir=guest_dir[1:],
options=options)
ret, _, _ = self.container.ssh.exec_command_sudo(
"sh -c 'echo \"{e}\" >> /var/lib/lxc/{c.name}/config'".