[lxc-devel] [pylxd/master] Fix ephermal container stop

om26er on Github lxc-bot at linuxcontainers.org
Wed Mar 8 15:02:35 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 390 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170308/54107e34/attachment.bin>
-------------- next part --------------
From 5cf57c31b976c75e99338ebd11ee8c01d9b5d678 Mon Sep 17 00:00:00 2001
From: Omer Akram <om26er at gmail.com>
Date: Wed, 8 Mar 2017 20:01:07 +0500
Subject: [PATCH] Fix ephermal container stop

---
 pylxd/models/container.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pylxd/models/container.py b/pylxd/models/container.py
index 6c59b84..35e86db 100644
--- a/pylxd/models/container.py
+++ b/pylxd/models/container.py
@@ -158,7 +158,10 @@ def _set_state(self, state, timeout=30, force=True, wait=False):
                 response.json()['operation'])
             if 'status' in self.__dirty__:
                 del self.__dirty__[self.__dirty__.index('status')]
-            self.sync()
+            if self.ephemeral and state == 'stop':
+                self.client = None
+            else:
+                self.sync()
 
     def state(self):
         response = self.api.state.get()


More information about the lxc-devel mailing list