|
43 | 43 | 20160831, Niklas - ver 5.7b - added pseudo node fix from Pathman project |
44 | 44 | 20160905, Niklas - ver 5.8 - Added ODL version detection and new netconf urls for Boron. |
45 | 45 | 20160906, Giles - ver 5.9 - Fixed TE metric get for ISIS, |
46 | | - 20160906, Niklas - ver 5.9 - Added topologies for TE and IGP metrics |
| 46 | + 20160906, Niklas - ver 5.9b - Added topologies for TE and IGP metrics |
| 47 | + 20160912, Niklas - ver 5.9c - Fixed Boron version check from false positives |
47 | 48 | """ |
48 | 49 | __author__ = 'niklas' |
49 | 50 |
|
|
60 | 61 |
|
61 | 62 |
|
62 | 63 | #============================================================== |
63 | | -version = '5.9b' |
| 64 | +version = '5.9c' |
64 | 65 | # Defaults overridden by pathman_ini.py |
65 | 66 | odl_ip = '127.0.0.1' |
66 | 67 | odl_port = '8181' |
|
100 | 101 |
|
101 | 102 | string = "bgpls://IsisLevel2:1/type=node&as=65504&domain=505290270&router=0000.0000.0029" |
102 | 103 |
|
103 | | -odl_version_dict = {'beryllium':{'name':"odl-rsvp-parser-spi-cfg", 'revision':"2015-08-26"}, |
104 | | - 'lithium':{'name':"aaa-authn-model", 'revision':"2014-10-29"}, |
105 | | - 'helium':{'name':"opendaylight-topology", 'revision':"2013-10-30"}, |
106 | | - 'boron':{'name': "openconfig-interfaces", 'revision': "2016-04-12"}, |
107 | | - } |
| 104 | +odl_version_list = [ |
| 105 | + {'boron':{'name': "openconfig-interfaces", 'revision': "2016-04-12"}}, |
| 106 | + {'beryllium':{'name':"odl-rsvp-parser-spi-cfg", 'revision':"2015-08-26"}}, |
| 107 | + {'lithium':{'name':"aaa-authn-model", 'revision':"2014-10-29"}}, |
| 108 | + {'helium':{'name':"opendaylight-topology", 'revision':"2013-10-30"}}, |
| 109 | + ] |
108 | 110 |
|
109 | 111 | lsp07_xml = '''<input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep"> |
110 | 112 | <node>{pcc}</node> |
@@ -317,14 +319,14 @@ def version_check(): |
317 | 319 | if True: |
318 | 320 | name_list = [mod['name'] for mod in result['modules']['module']] |
319 | 321 | rev_list = [mod['revision'] for mod in result['modules']['module']] |
320 | | - for odl_ver in odl_version_dict.keys(): |
321 | | - if odl_version_dict[odl_ver]['name'] in name_list: |
322 | | - if odl_version_dict[odl_ver]['revision'] == rev_list[name_list.index(odl_version_dict[odl_ver]['name'])]: |
323 | | - logging.info("Found ODL Release: %s" % odl_ver) |
324 | | - return odl_ver |
| 322 | + for odl_ver in odl_version_list: |
| 323 | + version = odl_ver.keys()[0] |
| 324 | + if odl_ver[version]['name'] in name_list: |
| 325 | + if odl_ver[version]['revision'] == rev_list[name_list.index(odl_ver[version]['name'])]: |
| 326 | + logging.info("Found ODL Release: %s" % version) |
| 327 | + return version |
325 | 328 | return "" |
326 | 329 |
|
327 | | - |
328 | 330 | def netconf_list(dummy=None): |
329 | 331 | '''modified from from odl_gateway''' |
330 | 332 |
|
@@ -731,8 +733,15 @@ def list_pcep_lsp(node_list, debug): |
731 | 733 | sid_list = [] |
732 | 734 | if 'odl-pcep-ietf-stateful07:lsp' in path['path'][0].keys(): |
733 | 735 | if 'operational' in path['path'][0]['odl-pcep-ietf-stateful07:lsp'].keys(): |
734 | | - if path['path'][0]['odl-pcep-ietf-stateful07:lsp']['operational'] == 'up': |
735 | | - for nexthop in path['path'][0]['ero']['subobject']: |
| 736 | + oper = path['path'][0]['odl-pcep-ietf-stateful07:lsp']['operational'] |
| 737 | + # if path['path'][0]['odl-pcep-ietf-stateful07:lsp']['operational'] == 'up': |
| 738 | + if oper == 'up' or oper == 'active': |
| 739 | + if 'rro' in path['path'][0].keys(): |
| 740 | + route_obj = path['path'][0]['rro']['subobject'] |
| 741 | + else: |
| 742 | + route_obj = path['path'][0]['ero']['subobject'] |
| 743 | + # for nexthop in path['path'][0]['ero']['subobject']: |
| 744 | + for nexthop in route_obj: |
736 | 745 | if 'ip-prefix' in nexthop.keys(): |
737 | 746 | ip_hoplist.append(nexthop['ip-prefix']['ip-prefix']) |
738 | 747 | if 'odl-pcep-segment-routing:sid-type' in nexthop.keys(): |
|
0 commit comments