]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: fix munet accessing missing attribute
authorChristian Hopps <chopps@labn.net>
Wed, 17 Jan 2024 09:18:21 +0000 (09:18 +0000)
committerChristian Hopps <chopps@labn.net>
Wed, 17 Jan 2024 09:18:21 +0000 (09:18 +0000)
Signed-off-by: Christian Hopps <chopps@labn.net>
tests/topotests/munet/base.py

index c007ba36cda8295526e77e5f5f06a186967c66de..72b5df54b965c9645a11d4f77712f4c737bfc381 100644 (file)
@@ -21,7 +21,6 @@ import subprocess
 import sys
 import tempfile
 import time as time_mod
-
 from collections import defaultdict
 from pathlib import Path
 from typing import Union
@@ -29,10 +28,8 @@ from typing import Union
 from . import config as munet_config
 from . import linux
 
-
 try:
     import pexpect
-
     from pexpect.fdpexpect import fdspawn
     from pexpect.popen_spawn import PopenSpawn
 
@@ -1237,7 +1234,7 @@ class Commander:  # pylint: disable=R0904
             envvars = f"MUNET_NODENAME={self.name} NODENAME={self.name}"
             if hasattr(self, "rundir"):
                 envvars += f" RUNDIR={self.rundir}"
-            if self.unet.config_dirname:
+            if hasattr(self.unet, "config_dirname") and self.unet.config_dirname:
                 envvars += f" CONFIGDIR={self.unet.config_dirname}"
             elif "CONFIGDIR" in os.environ:
                 envvars += f" CONFIGDIR={os.environ['CONFIGDIR']}"