summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSenthil Kumar Ganesan <skg.net.dev@gmail.com>2017-04-13 08:30:26 -0700
committerJohn R Barker <john@johnrbarker.com>2017-04-13 11:30:26 -0400
commit9e72e870221438ef47f1fc32328c7a6f5fc88eba (patch)
tree2687a5b0c8ada7d6d3bdaf0795c8ddfd978d2320
parentcfe3c844f478d0c9d58e16fb09d37898190983af (diff)
downloadansible-modules-core-9e72e870221438ef47f1fc32328c7a6f5fc88eba.tar.gz
Fix fanout issue for OS10 10.2.2 release (#5904)
-rw-r--r--network/dellos10/dellos10_facts.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/network/dellos10/dellos10_facts.py b/network/dellos10/dellos10_facts.py
index 1ff516bf..e769f29a 100644
--- a/network/dellos10/dellos10_facts.py
+++ b/network/dellos10/dellos10_facts.py
@@ -290,21 +290,23 @@ class Interfaces(FactsBase):
for interface in interfaces.findall('./data/ports/ports-state/port'):
name = self.parse_item(interface, 'name')
- fanout = self.parse_item(interface, 'fanout-state')
- mediatype = self.parse_item(interface, 'media-type')
+ # media-type name interface name format phy-eth 1/1/1
+ mediatype = self.parse_item(interface, 'media-type')
typ, sname = name.split('-eth')
-
- if fanout == "BREAKOUT_1x1":
- name = "ethernet" + sname
+ name = "ethernet" + sname
+ try:
intf = int_facts[name]
- intf['mediatype'] = mediatype
- else:
- #TODO: Loop for the exact subport
+ intf['mediatype'] = mediatype
+ except:
+ # fanout
for subport in xrange(1, 5):
name = "ethernet" + sname + ":" + str(subport)
- intf = int_facts[name]
- intf['mediatype'] = mediatype
+ try:
+ intf = int_facts[name]
+ intf['mediatype'] = mediatype
+ except:
+ pass
return int_facts