fix: get_status returns actual configured WG address instead of hardcoded default
Unit Tests / test (push) Successful in 7m41s
Unit Tests / test (push) Successful in 7m41s
The address field in get_status() was hardcoded to SERVER_ADDRESS
('10.0.0.1/24') regardless of what wg0.conf contains, so instances
with a non-default subnet (e.g. pic1 at 10.0.1.1/24) always reported
the wrong server IP to callers such as the e2e WG conftest fixture.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1094,12 +1094,14 @@ class WireGuardManager(BaseServiceManager):
|
||||
capture_output=True, text=True, timeout=5,
|
||||
)
|
||||
running = 'cell-wireguard' in result.stdout
|
||||
configured_addr = self._get_configured_address()
|
||||
return {
|
||||
'running': running,
|
||||
'status': 'online' if running else 'offline',
|
||||
'interface': 'wg0',
|
||||
'listen_port': self._get_configured_port(),
|
||||
'ip_info': {'address': SERVER_ADDRESS} if running else {},
|
||||
'address': configured_addr if running else None,
|
||||
'ip_info': {'address': configured_addr} if running else {},
|
||||
'peers_count': len(self.get_peers()),
|
||||
'timestamp': datetime.utcnow().isoformat(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user