From 79a7b63f1c4e79ad68fe7d55b3117d44d8f1b6d1 Mon Sep 17 00:00:00 2001 From: John Dilley Date: Fri, 23 Oct 2015 17:23:48 +0100 Subject: [PATCH] Add noport --- exec/xenrt/racktableslink.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exec/xenrt/racktableslink.py b/exec/xenrt/racktableslink.py index 299130508..64bd5988b 100755 --- a/exec/xenrt/racktableslink.py +++ b/exec/xenrt/racktableslink.py @@ -49,6 +49,9 @@ def readMachineFromRackTables(machine,kvm=False,xrtMachine=None): else: availablePorts = sorted([p for p in ports if (p[2] or ignoreMissingMACs) and p[4] and p[0].startswith("e")], key=lambda x: re.sub(r"(\D)(\d)$",r"\g<1>0\g<2>",x[0])) xenrt.GEC().config.setVariable(["HOST_CONFIGS", machine, "FORCE_NIC_ORDER"], "yes") + # If there aren't any connected ports, use the first one anyway + if len(availablePorts) == 0: + availablePorts = sorted([p for p in ports if (p[2] or ignoreMissingMACs) and p[0].startswith("e")], key=lambda x: re.sub(r"(\D)(\d)$",r"\g<1>0\g<2>",x[0])) if len(availablePorts) > 0: mac = availablePorts[0][2] if availablePorts[0][1].startswith("10G"): -- 2.39.5