Push Tracker
ria-ran--sim-drop/server/core_adapters/free5gc.py
A ashkan@beigi.net 0be02bd1f4 Harden: fix bare-filename db path crash, configurable APN
- Fix FileNotFoundError when database.path has no directory component
  (os.makedirs(os.path.dirname(path)) with path="subscribers.db" raised).
  Add ensure_parent_dir helper; use it in app.py and scripts/init_db.py.
- Open5GS/free5gc adapters now use profile.apn for the core session/DNN name
  instead of a hardcoded "internet"; apn is threaded through get_adapter.

Tests: +4 (ensure_parent_dir, adapter APN); 82 pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 06:13:26 +00:00

13 lines
402 B
Python

from .open5gs import Open5GSAdapter
class Free5GCAdapter(Open5GSAdapter):
"""free5gc adapter — uses the same MongoDB document schema as Open5GS.
Override methods here as free5gc-specific behaviour is needed.
"""
def __init__(self, mongodb_uri: str, database_name: str = "free5gc",
apn: str = "internet"):
super().__init__(mongodb_uri, database_name, apn)