[lxc-devel] [lxd/master] lxc-to-lxd: Check that source path exists (disk)
stgraber on Github
lxc-bot at linuxcontainers.org
Thu Oct 27 16:03:05 UTC 2016
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20161027/214e26e0/attachment.bin>
-------------- next part --------------
From bbcbe2853149abcae757a666afab985fd23bf28f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 27 Oct 2016 11:30:34 -0400
Subject: [PATCH] lxc-to-lxd: Check that source path exists (disk)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Closes #2572
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
scripts/lxc-to-lxd | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/lxc-to-lxd b/scripts/lxc-to-lxd
index aa60011..48754c5 100755
--- a/scripts/lxc-to-lxd
+++ b/scripts/lxc-to-lxd
@@ -238,6 +238,9 @@ def convert_container(container_name, args):
# Deal with optional mounts
if "optional" in mount[3].split(","):
device['optional'] = "true"
+ elif not os.path.exists(mount[0]):
+ print("Invalid mount configuration, source path doesn't exist.")
+ return False
# Set the source
device['source'] = mount[0]
More information about the lxc-devel
mailing list