File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1852,15 +1852,17 @@ def parse_device_desc_xml(filename):
18521852 results ['LOOPBACK_INTERFACE' ] = {('lo_v6' , lo_prefix_v6 ): {}}
18531853
18541854 results ['MGMT_INTERFACE' ] = {}
1855- if mgmt_prefix and mgmt_prefix != '0.0.0.0/0' :
1855+ if mgmt_prefix :
18561856 mgmtipn = ipaddress .ip_network (UNICODE_TYPE (mgmt_prefix ), False )
1857- gwaddr = ipaddress .ip_address ((next (mgmtipn .hosts ())))
1858- results ['MGMT_INTERFACE' ].update ({('eth0' , mgmt_prefix ): {'gwaddr' : gwaddr }})
1857+ if mgmtipn != ipaddress .ip_network (u'0.0.0.0/0' , False ):
1858+ gwaddr = ipaddress .ip_address ((next (mgmtipn .hosts ())))
1859+ results ['MGMT_INTERFACE' ].update ({('eth0' , mgmt_prefix ): {'gwaddr' : gwaddr }})
18591860
1860- if mgmt_prefix_v6 and mgmt_prefix_v6 != '::/0' :
1861+ if mgmt_prefix_v6 :
18611862 mgmtipn_v6 = ipaddress .ip_network (UNICODE_TYPE (mgmt_prefix_v6 ), False )
1862- gwaddr_v6 = ipaddress .ip_address ((next (mgmtipn_v6 .hosts ())))
1863- results ['MGMT_INTERFACE' ].update ({('eth0' , mgmt_prefix_v6 ): {'gwaddr' : gwaddr_v6 }})
1863+ if mgmtipn != ipaddress .ip_network (u'::/0' , False ):
1864+ gwaddr_v6 = ipaddress .ip_address ((next (mgmtipn_v6 .hosts ())))
1865+ results ['MGMT_INTERFACE' ].update ({('eth0' , mgmt_prefix_v6 ): {'gwaddr' : gwaddr_v6 }})
18641866
18651867 return results
18661868
You can’t perform that action at this time.
0 commit comments