MaheshRaju-Huawei

PCE WEB and pcep tunnel related defect fix

Change-Id: If7056cd4740744e2fd9172d62b6749771fc8d321
...@@ -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');
......
...@@ -83,6 +83,7 @@ import org.onosproject.pcep.controller.PcepEventListener; ...@@ -83,6 +83,7 @@ import org.onosproject.pcep.controller.PcepEventListener;
83 import org.onosproject.pcep.controller.PcepLspStatus; 83 import org.onosproject.pcep.controller.PcepLspStatus;
84 import org.onosproject.pcep.controller.PcepLspSyncAction; 84 import org.onosproject.pcep.controller.PcepLspSyncAction;
85 import org.onosproject.pcep.controller.SrpIdGenerators; 85 import org.onosproject.pcep.controller.SrpIdGenerators;
86 +import org.onosproject.pcep.controller.PcepSyncStatus;
86 import org.onosproject.pcepio.exceptions.PcepParseException; 87 import org.onosproject.pcepio.exceptions.PcepParseException;
87 import org.onosproject.pcepio.protocol.PcInitiatedLspRequest; 88 import org.onosproject.pcepio.protocol.PcInitiatedLspRequest;
88 import org.onosproject.pcepio.protocol.PcepAttribute; 89 import org.onosproject.pcepio.protocol.PcepAttribute;
...@@ -968,6 +969,11 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid ...@@ -968,6 +969,11 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
968 */ 969 */
969 private void pcepSetupTunnel(Tunnel tunnel, Path path, PcepClient pc) { 970 private void pcepSetupTunnel(Tunnel tunnel, Path path, PcepClient pc) {
970 try { 971 try {
972 + if (!(pc.lspDbSyncStatus().equals(PcepSyncStatus.SYNCED))) {
973 + log.error("Setup tunnel has failed as LSP DB sync is not finished");
974 + return;
975 + }
976 +
971 int srpId = SrpIdGenerators.create(); 977 int srpId = SrpIdGenerators.create();
972 Collection<Tunnel> tunnels = tunnelService.queryTunnel(tunnel.src(), tunnel.dst()); 978 Collection<Tunnel> tunnels = tunnelService.queryTunnel(tunnel.src(), tunnel.dst());
973 for (Tunnel t : tunnels) { 979 for (Tunnel t : tunnels) {
...@@ -1021,6 +1027,11 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid ...@@ -1021,6 +1027,11 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
1021 */ 1027 */
1022 private void pcepReleaseTunnel(Tunnel tunnel, PcepClient pc) { 1028 private void pcepReleaseTunnel(Tunnel tunnel, PcepClient pc) {
1023 try { 1029 try {
1030 + if (!(pc.lspDbSyncStatus().equals(PcepSyncStatus.SYNCED))) {
1031 + log.error("Release tunnel has failed as LSP DB sync is not finished");
1032 + return;
1033 + }
1034 +
1024 PcepTunnelData pcepTunnelData = new PcepTunnelData(tunnel, DELETE); 1035 PcepTunnelData pcepTunnelData = new PcepTunnelData(tunnel, DELETE);
1025 pcepTunnelApiMapper.addToCoreTunnelRequestQueue(pcepTunnelData); 1036 pcepTunnelApiMapper.addToCoreTunnelRequestQueue(pcepTunnelData);
1026 int srpId = SrpIdGenerators.create(); 1037 int srpId = SrpIdGenerators.create();
......