Temporarily switch shared data to the requested SSID context.
(self, ssid: Optional[str])
| 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 |
no test coverage detected