]> xenbits.xensource.com Git - xenrt-citrix/xenrt.git/commitdiff
Add noport
authorJohn Dilley <john.dilley@citrix.com>
Fri, 23 Oct 2015 16:23:48 +0000 (17:23 +0100)
committerJohn Dilley <john.dilley@citrix.com>
Fri, 23 Oct 2015 16:23:48 +0000 (17:23 +0100)
exec/xenrt/racktableslink.py

index 299130508c6c7598b7541f9c8169839c3569ba32..64bd5988ba984acebf17da06b892fbac9d2bfb55 100755 (executable)
@@ -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"):