Commit 36b67b23 authored by Antonio Gines Buendia Lopez's avatar Antonio Gines Buendia Lopez
Browse files

Remove old condition based on per-provisioning send network context

parent cc429f7c
Loading
Loading
Loading
Loading
+6 −16
Original line number Diff line number Diff line
@@ -95,20 +95,10 @@ class PathCompExtendedServiceServicerImpl(PathCompExtendedServiceServicer):
                    for topology in request.topologies
                ])

                # Apply hash to track network state changes
                network_hash = hashlib.sha256(
                    json.dumps(hrat_request.model_dump(by_alias=True, exclude_none=True), sort_keys=True).encode()
                ).hexdigest()
                must_send_context = network_hash != self._last_network_hash
                
                if must_send_context:
                    LOGGER.debug("Network state changed, updating HRAT network context")
                LOGGER.debug("Updating network context on H-RAT")
                with self._lock:
                    hrat_response = self._hrat_client.network_context(hrat_request)
                        self._last_network_hash = network_hash
                    LOGGER.debug("HRAT network context updated successfully: {:s}".format(hrat_response.message))
                else:
                    LOGGER.debug("Network state unchanged, skipping HRAT context update")

            except Exception as e:
                LOGGER.error('[CreateNetworkContext] Error sending context to H-RAT: {:s}'.format(str(e)))