MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / update_network_context

Method update_network_context

network_intelligence.py:175–197  ·  view source on GitHub ↗

Update current network context and handle network changes

(self)

Source from the content-addressed store, hash-verified

173 return f"net_{network_hash}"
174
175 def update_network_context(self):
176 """Update current network context and handle network changes"""
177 try:
178 new_network = self.get_current_network_id()
179
180 # Check for network change
181 if new_network != self.current_network:
182 self.logger.info(f"Network change detected: {self.current_network} -> {new_network}")
183
184 # Handle network change
185 self.handle_network_change(self.current_network, new_network)
186
187 # Update network context
188 self.previous_network = self.current_network
189 self.current_network = new_network
190 self.network_change_time = datetime.now()
191
192 # Update network profile if we have a valid network
193 if new_network:
194 self.update_network_profile(new_network)
195
196 except Exception as e:
197 self.logger.error(f"Error updating network context: {e}")
198
199 def handle_network_change(self, old_network: Optional[str], new_network: Optional[str]):
200 """Handle network change by managing finding states"""

Callers 2

sync_vulnerability_countFunction · 0.80
get_network_intelligenceFunction · 0.80

Calls 5

handle_network_changeMethod · 0.95
infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected