[lxc-devel] [lxd/master] Fixed container convert from LXC to LXD

d4s on Github lxc-bot at linuxcontainers.org
Mon Sep 26 18:02:51 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 407 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160926/956af62b/attachment.bin>
-------------- next part --------------
From fb4218ad84f0bed875a28a63246befd28c8dfd01 Mon Sep 17 00:00:00 2001
From: Denis Pynkin <dans at altlinux.org>
Date: Mon, 26 Sep 2016 21:00:00 +0300
Subject: [PATCH] Fixed container convert from LXC to LXD

Added LXDAPI exception during container name check.

Signed-off-by: Denis Pynkin <denis_pynkin at epam.com>
---
 scripts/lxc-to-lxd | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/lxc-to-lxd b/scripts/lxc-to-lxd
index df8fbf5..aa60011 100755
--- a/scripts/lxc-to-lxd
+++ b/scripts/lxc-to-lxd
@@ -6,6 +6,7 @@ import lxc
 import os
 import subprocess
 from pylxd.client import Client
+from pylxd import exceptions
 
 
 # Fetch a config key as a list
@@ -110,7 +111,7 @@ def convert_container(container_name, args):
         lxd.containers.get(container_name)
         print("Container already exists, skipping...")
         return False
-    except NameError:
+    except (NameError, exceptions.LXDAPIException):
         pass
 
     # Validate lxc.utsname


More information about the lxc-devel mailing list