From 52bbb5d8f9d35a22f54674f098149a24657d2cb4 Mon Sep 17 00:00:00 2001 From: Jan Tluka Date: Thu, 9 May 2024 16:42:39 +0200 Subject: [PATCH] Controller/Machine.py: handle exceptions when accessing peer_name attribute Signed-off-by: Jan Tluka --- lnst/Controller/Machine.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py index 3fabcaf0b..9555fc1a7 100644 --- a/lnst/Controller/Machine.py +++ b/lnst/Controller/Machine.py @@ -135,8 +135,11 @@ def remote_device_set_netns(self, dev, dst, src): dev_args = dev._dev_args dev_kwargs = dev._dev_kwargs - if dev.peer_name: - dev_kwargs['peer_name'] = dev.peer_name + try: + if dev.peer_name: + dev_kwargs['peer_name'] = dev.peer_name + except AttributeError: + pass self.rpc_call("remap_device", dev.ifindex,