[lxc-devel] [lxd/master] lxc-to-lxd: Properly handle lxc.seccomp

stgraber on Github lxc-bot at linuxcontainers.org
Thu Aug 3 16:51:15 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170803/fb57408a/attachment.bin>
-------------- next part --------------
From 737fec185d6bac3d853e4b8e85582a0f2dd33c39 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 3 Aug 2017 12:50:49 -0400
Subject: [PATCH] lxc-to-lxd: Properly handle lxc.seccomp
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 scripts/lxc-to-lxd | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/lxc-to-lxd b/scripts/lxc-to-lxd
index 6c3ddd3c7..14104a6fa 100755
--- a/scripts/lxc-to-lxd
+++ b/scripts/lxc-to-lxd
@@ -89,7 +89,7 @@ keys_to_check = [
     'lxc.mount.entry',
     'lxc.cap.drop'
     # 'lxc.cap.keep',
-    # 'lxc.seccomp',
+    'lxc.seccomp',
     # 'lxc.se_context',
     ]
 
@@ -218,7 +218,7 @@ def convert_container(lxd_socket, container_name, args):
     # Load the container
     try:
         container = lxc.Container(container_name, args.lxcpath)
-    except:
+    except Exception:
         print("Invalid container configuration, skipping...")
         return False
 
@@ -326,7 +326,7 @@ def convert_container(lxd_socket, container_name, args):
     print("Processing network configuration")
     try:
         count = len(container.get_config_item("lxc.network"))
-    except:
+    except Exception:
         count = 0
 
     for i in range(count):
@@ -457,7 +457,7 @@ def convert_container(lxd_socket, container_name, args):
     # Convert seccomp
     print("Processing container seccomp configuration")
     value = config_get(lxc_config, "lxc.seccomp")
-    if value:
+    if value and value != "/usr/share/lxc/config/common.seccomp":
         print("Custom seccomp profiles aren't supported, skipping...")
         return False
 
@@ -506,7 +506,7 @@ def convert_container(lxd_socket, container_name, args):
             new['architecture'] = arches[arch[0]]
         else:
             print("Unknown architecture, assuming native.")
-    except:
+    except Exception:
         print("Couldn't find container architecture, assuming native.")
 
     # Define the container in LXD


More information about the lxc-devel mailing list