[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lxc-devel
Subject:    [lxc-devel] [pylxd/master] Update cert check to look in snap path as well
From:       ChrisMacNaughton on Github <lxc-bot () linuxcontainers ! org>
Date:       2017-09-27 15:52:06
Message-ID: 20170927155206.C8C544D485 () 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/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

[Attachment #3 (text/plain)]

From 6cbb80e5fab0c10c02a63cb939aa0fd8df0ac4dd Mon Sep 17 00:00:00 2001
From: Chris MacNaughton <chris@centaurisolutions.nl>
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,

[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