Fix clearing interface config on job end 12/70612/1
authorSawyer Bergeron <sbergeron@iol.unh.edu>
Thu, 30 Jul 2020 17:26:20 +0000 (13:26 -0400)
committerSawyer Bergeron <sbergeron@iol.unh.edu>
Thu, 30 Jul 2020 17:26:20 +0000 (13:26 -0400)
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: Ia38de492c01de66a14f6966fcf35db5e51f007c5

src/api/models.py

index ce62ea5..9f666b7 100644 (file)
@@ -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