[prev in list] [next in list] [prev in thread] [next in thread]
List: lxc-devel
Subject: [lxc-devel] [lxd/master] lxd-p2c: Respect LXD_SOCKET environment variable
From: ganto on Github <lxc-bot () linuxcontainers ! org>
Date: 2018-05-30 4:48:20
Message-ID: 20180530044820.43D6956B15 () mailman01 ! srv ! dcmtl ! stgraber ! net
[Download RAW message or body]
[Attachment #2 (text/x-mailbox)]
The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/4610
This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.
=== Description (from pull-request) ===
The unix socket path of the LXD service can be customized via
LXD_SOCKET variable. Make sure this is also supported when migrating
containers from LXC to LXD.
[Attachment #3 (text/plain)]
From a8e232d7d4ff23544c54cdd4678335fe7988cf3e Mon Sep 17 00:00:00 2001
From: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
Date: Wed, 30 May 2018 06:41:49 +0200
Subject: [PATCH] lxd-p2c: Respect LXD_SOCKET environment variable
The unix socket path of the LXD service can be customized via
LXD_SOCKET variable. Make sure this is also supported when migrating
containers from LXC to LXD.
Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
---
scripts/lxc-to-lxd | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/scripts/lxc-to-lxd b/scripts/lxc-to-lxd
index 1aaa964a2..4a93a4e16 100755
--- a/scripts/lxc-to-lxd
+++ b/scripts/lxc-to-lxd
@@ -601,7 +601,10 @@ if (not args.containers and not args.all) or (args.containers and args.all):
parser.error("You must either pass container names or --all")
# Connect to LXD
-lxd_socket = os.path.join(args.lxdpath, "unix.socket")
+if 'LXD_SOCKET' in os.environ:
+ lxd_socket = os.environ['LXD_SOCKET']
+else:
+ lxd_socket = os.path.join(args.lxdpath, "unix.socket")
if not os.path.exists(lxd_socket):
print("LXD isn't running.")
[Attachment #4 (text/plain)]
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic