aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/Mellanox.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/Mellanox.py b/drivers/Mellanox.py
index dbdd104..ea74bf0 100644
--- a/drivers/Mellanox.py
+++ b/drivers/Mellanox.py
@@ -142,8 +142,19 @@ class Mellanox(SwitchDriver):
self._cli("vlan %d name %s" % (tag, name))
self._end_configure()
- # Validate it happened
- read_name = self.vlan_get_name(tag)
+ # This switch *might* have problems if we drive it too quickly? At
+ # least one instance of set_name()/get_name() not working. This
+ # might help?
+ self._delay()
+
+ # And retry around here
+ retries = 5
+ read_name = None
+ while (retries > 0 and read_name is None):
+ # Validate it happened
+ read_name = self.vlan_get_name(tag)
+ retries -= 1
+
if read_name != name:
raise IOError("Failed to set name for VLAN %d (name found is \"%s\", not \"%s\")"
% (tag, read_name, name))
@@ -206,6 +217,8 @@ class Mellanox(SwitchDriver):
match = regex.match(line)
if match:
name = re.sub(r'Eth.*$',"",match.group(1)).strip()
+ if name is None:
+ logging.debug("vlan_get_name: did not find a name")
return name
except PExpectError: