From 47f9fb16cbd0f9c761a87f5fe0f5d30a56b54452 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 --- zun/objects/container.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zun/objects/container.py b/zun/objects/container.py index 5c088d21b..d0827ae34 100644 --- a/zun/objects/container.py +++ b/zun/objects/container.py @@ -392,6 +392,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()