From 307617805dfb2ca32761c2db3aaa472b6811a7bf Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Sun, 10 Mar 2019 19:06:16 +0000 Subject: [PATCH] Add the 'containers' field back to capsule The capsule object is used to have the 'containers' field which is the list of container objects. This field was accidentally removed during the merging of data model into container. This commit adds this field back. Change-Id: I2cdf365ae4c394eeef6672eed59855f36e7006fc (cherry picked from commit 47f9fb16cbd0f9c761a87f5fe0f5d30a56b54452) --- zun/objects/container.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zun/objects/container.py b/zun/objects/container.py index f392ab48a..297620c42 100644 --- a/zun/objects/container.py +++ b/zun/objects/container.py @@ -418,6 +418,11 @@ class Capsule(ContainerBase): nullable=True), } + def as_dict(self): + capsule_dict = super(Capsule, self).as_dict() + capsule_dict['containers'] = [c.as_dict() for c in self.containers] + return capsule_dict + def obj_load_attr(self, attrname): if attrname == 'containers': self._load_capsule_containers()