The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/pylxd/pull/253
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) === When using a snap installed LXD, we need to look in the $HOME/snap directory rather than looking in ~ for the certificates Fixes #251
From 6cbb80e5fab0c10c02a63cb939aa0fd8df0ac4dd Mon Sep 17 00:00:00 2001 From: Chris MacNaughton <[email protected]> Date: Wed, 27 Sep 2017 11:25:55 -0400 Subject: [PATCH] Update cert check to look in snap path as well When using a snap installed LXD, we need to look in the $HOME/snap directory rather than looking in ~ for the certificates Fixes #251 --- pylxd/client.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pylxd/client.py b/pylxd/client.py index 499ce7d..9705435 100644 --- a/pylxd/client.py +++ b/pylxd/client.py @@ -192,10 +192,15 @@ class Client(object): >>> print api.containers['test'].get().json() """ - - DEFAULT_CERTS = ( - os.path.expanduser('~/.config/lxc/client.crt'), - os.path.expanduser('~/.config/lxc/client.key')) + if os.path.exists( + os.path.expanduser('~/snap/lxd/current/.config/lxc/client.crt')): + DEFAULT_CERTS = ( + os.path.expanduser('~/snap/lxd/current/.config/lxc/client.crt'), + os.path.expanduser('~/snap/lxd/current/.config/lxc/client.key')) + else: + DEFAULT_CERTS = ( + os.path.expanduser('~/.config/lxc/client.crt'), + os.path.expanduser('~/.config/lxc/client.key')) def __init__( self, endpoint=None, version='1.0', cert=None, verify=True,
_______________________________________________ lxc-devel mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-devel
