From 8e8ffb3ffb4ba8ba03d7aa239c093e28f3e3eb35 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Thu, 23 Apr 2020 14:00:23 -0700 Subject: [PATCH 1/2] pygui close mac config dialog on save --- daemon/core/gui/dialogs/macdialog.py | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/core/gui/dialogs/macdialog.py b/daemon/core/gui/dialogs/macdialog.py index 6b6faf95..fa5d81ad 100644 --- a/daemon/core/gui/dialogs/macdialog.py +++ b/daemon/core/gui/dialogs/macdialog.py @@ -59,3 +59,4 @@ class MacConfigDialog(Dialog): self.app.core.interfaces_manager.mac = netaddr.EUI(mac) self.app.guiconfig["mac"] = mac self.app.save_config() + self.destroy() From b7adbd289c2dba40d47bff39bfac69e1aa64d8d5 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Thu, 23 Apr 2020 14:04:22 -0700 Subject: [PATCH 2/2] pygui copy links when generating mac to avoid retaining generated macs --- daemon/core/gui/coreclient.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/daemon/core/gui/coreclient.py b/daemon/core/gui/coreclient.py index d93cdf51..b6b13c58 100644 --- a/daemon/core/gui/coreclient.py +++ b/daemon/core/gui/coreclient.py @@ -487,14 +487,13 @@ class CoreClient: nodes = [x.core_node for x in self.canvas_nodes.values()] links = [] for edge in self.links.values(): - link = edge.link - logging.info("link: %s", link) + link = core_pb2.Link() + link.CopyFrom(edge.link) if link.HasField("interface_one") and not link.interface_one.mac: link.interface_one.mac = self.interfaces_manager.next_mac() if link.HasField("interface_two") and not link.interface_two.mac: link.interface_two.mac = self.interfaces_manager.next_mac() links.append(link) - links = [x.link for x in self.links.values()] wlan_configs = self.get_wlan_configs_proto() mobility_configs = self.get_mobility_configs_proto() emane_model_configs = self.get_emane_model_configs_proto()