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

Method activate

multi_interface.py:54–69  ·  view source on GitHub ↗

Temporarily switch shared data to the requested SSID context.

(self, ssid: Optional[str])

Source from the content-addressed store, hash-verified

52 def _durable_context(self) -> Optional[Dict[str, str]]:
53 """The context storage actually considers active.
54
55 activate() only ever takes snapshots, so storage_manager.active_* is
56 never touched by a scan override — it is the durable truth. Restoring
57 to it (instead of a snapshot taken before the job) also stays correct
58 if a genuine network change lands while a scan is running.
59 """
60 try:
61 return self.shared_data.storage_manager.get_active_context()
62 except Exception as exc:
63 logger.warning(f"Unable to read durable network context: {exc}")
64 return None
65
66 def _apply_context(self, context: Optional[Dict[str, str]]):
67 if not context:
68 return
69 self.shared_data._apply_network_context(context, configure_db=False)
70 self.shared_data._refresh_network_components()
71
72 @contextmanager

Callers 3

runMethod · 0.80

Calls 3

_snapshot_currentMethod · 0.95
_apply_contextMethod · 0.95
get_context_snapshotMethod · 0.80

Tested by

no test coverage detected