diff options
author | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2020-07-30 13:26:20 -0400 |
---|---|---|
committer | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2020-07-30 13:26:20 -0400 |
commit | 38a3d94323f0f169ad8ab5a533c6365592f4363d (patch) | |
tree | 0b1d25eb78a6668df428ebe8d9d758e8ca6ba182 /src/api | |
parent | 50e93d9861aab210cda256cacd88c4ef1af1f1ea (diff) |
Fix clearing interface config on job end
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: Ia38de492c01de66a14f6966fcf35db5e51f007c5
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/models.py | 9 |
1 files changed, 5 insertions, 4 deletions
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 |