MaheshRaju-Huawei

PCE WEB and pcep tunnel related defect fix

Change-Id: I5682982a4fc7a897517f3683cee4b2b5232783f5
...@@ -344,7 +344,7 @@ ...@@ -344,7 +344,7 @@
344 bw: bandValue, 344 bw: bandValue,
345 bwtype: bandType, 345 bwtype: bandType,
346 ctype: costTypeVal, 346 ctype: costTypeVal,
347 - tunnelname: tunnelIdUpd 347 + tunnelid: tunnelIdUpd
348 }); 348 });
349 349
350 flash.flash('update path message'); 350 flash.flash('update path message');
......
...@@ -86,6 +86,7 @@ import org.onosproject.pcep.controller.PcepEventListener; ...@@ -86,6 +86,7 @@ import org.onosproject.pcep.controller.PcepEventListener;
86 import org.onosproject.pcep.controller.PcepLspStatus; 86 import org.onosproject.pcep.controller.PcepLspStatus;
87 import org.onosproject.pcep.controller.PcepLspSyncAction; 87 import org.onosproject.pcep.controller.PcepLspSyncAction;
88 import org.onosproject.pcep.controller.SrpIdGenerators; 88 import org.onosproject.pcep.controller.SrpIdGenerators;
89 +import org.onosproject.pcep.controller.PcepSyncStatus;
89 import org.onosproject.pcepio.exceptions.PcepParseException; 90 import org.onosproject.pcepio.exceptions.PcepParseException;
90 import org.onosproject.pcepio.protocol.PcInitiatedLspRequest; 91 import org.onosproject.pcepio.protocol.PcInitiatedLspRequest;
91 import org.onosproject.pcepio.protocol.PcepAttribute; 92 import org.onosproject.pcepio.protocol.PcepAttribute;
...@@ -1034,6 +1035,11 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid ...@@ -1034,6 +1035,11 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
1034 */ 1035 */
1035 private void pcepSetupTunnel(Tunnel tunnel, Path path, PcepClient pc) { 1036 private void pcepSetupTunnel(Tunnel tunnel, Path path, PcepClient pc) {
1036 try { 1037 try {
1038 + if (!(pc.lspDbSyncStatus().equals(PcepSyncStatus.SYNCED))) {
1039 + log.error("Setup tunnel has failed as LSP DB sync is not finished");
1040 + return;
1041 + }
1042 +
1037 int srpId = SrpIdGenerators.create(); 1043 int srpId = SrpIdGenerators.create();
1038 Collection<Tunnel> tunnels = tunnelService.queryTunnel(tunnel.src(), tunnel.dst()); 1044 Collection<Tunnel> tunnels = tunnelService.queryTunnel(tunnel.src(), tunnel.dst());
1039 for (Tunnel t : tunnels) { 1045 for (Tunnel t : tunnels) {
...@@ -1087,6 +1093,11 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid ...@@ -1087,6 +1093,11 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
1087 */ 1093 */
1088 private void pcepReleaseTunnel(Tunnel tunnel, PcepClient pc) { 1094 private void pcepReleaseTunnel(Tunnel tunnel, PcepClient pc) {
1089 try { 1095 try {
1096 + if (!(pc.lspDbSyncStatus().equals(PcepSyncStatus.SYNCED))) {
1097 + log.error("Release tunnel has failed as LSP DB sync is not finished");
1098 + return;
1099 + }
1100 +
1090 PcepTunnelData pcepTunnelData = new PcepTunnelData(tunnel, DELETE); 1101 PcepTunnelData pcepTunnelData = new PcepTunnelData(tunnel, DELETE);
1091 pcepTunnelApiMapper.addToCoreTunnelRequestQueue(pcepTunnelData); 1102 pcepTunnelApiMapper.addToCoreTunnelRequestQueue(pcepTunnelData);
1092 int srpId = SrpIdGenerators.create(); 1103 int srpId = SrpIdGenerators.create();
......