[lxc-devel] [pylxd/master] Don't marshall not yet seen attributes, fixes #165.

pcdummy on Github lxc-bot at linuxcontainers.org
Mon Jul 25 12:34:31 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 346 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160725/66310cf8/attachment.bin>
-------------- next part --------------
From f896d6c7a06618114ff6f0af7a609f6cb5f4434e Mon Sep 17 00:00:00 2001
From: Rene Jochum <rene at jochums.at>
Date: Mon, 25 Jul 2016 14:32:35 +0200
Subject: [PATCH] Don't marshall not yet seen attributes, fixes #165.

Signed-off-by: Rene Jochum <rene at jochums.at>
---
 pylxd/model.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pylxd/model.py b/pylxd/model.py
index 9385afe..076f2cf 100644
--- a/pylxd/model.py
+++ b/pylxd/model.py
@@ -179,6 +179,6 @@ def marshall(self):
         """Marshall the object in preparation for updating to the server."""
         marshalled = {}
         for key, val in self.__attributes__.items():
-            if not val.readonly:
+            if not val.readonly and hasattr(self, key):
                 marshalled[key] = getattr(self, key)
         return marshalled


More information about the lxc-devel mailing list