From 38a3d94323f0f169ad8ab5a533c6365592f4363d Mon Sep 17 00:00:00 2001 From: Sawyer Bergeron Date: Thu, 30 Jul 2020 13:26:20 -0400 Subject: Fix clearing interface config on job end Signed-off-by: Sawyer Bergeron Change-Id: Ia38de492c01de66a14f6966fcf35db5e51f007c5 --- src/api/models.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/api/models.py b/src/api/models.py index ce62ea5..9f666b7 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -649,10 +649,11 @@ class NetworkConfig(TaskConfig): d[hid] = {} for interface in self.interfaces.all(): d[hid][interface.mac_address] = [] - for vlan in interface.config.all(): - # TODO: should this come from the interface? - # e.g. will different interfaces for different resources need different configs? - d[hid][interface.mac_address].append({"vlan_id": vlan.vlan_id, "tagged": vlan.tagged}) + if self.state != ConfigState.CLEAN: + for vlan in interface.config.all(): + # TODO: should this come from the interface? + # e.g. will different interfaces for different resources need different configs? + d[hid][interface.mac_address].append({"vlan_id": vlan.vlan_id, "tagged": vlan.tagged}) return d -- cgit 1.2.3-korg