Refactor GPU rental network handling and enhance IP management

- Renamed "FIP" to "IP" in the status output for clarity.
- Updated `create_gpu_server` to accept `port_id` as an optional parameter, allowing for more flexible network configurations.
- Introduced `delete_access_ip` function to manage direct public ports or floating IPs more effectively.
- Enhanced session management to prioritize direct public IPs over floating IPs, improving connection reliability.
- Added checks for direct network availability in the doctor command to ensure proper network functionality.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-23 18:19:34 +03:00
co-authored by Cursor
parent 0bad693b12
commit 8074426c43
7 changed files with 419 additions and 24 deletions
+2 -2
View File
@@ -144,8 +144,8 @@ def test_cmd_stop_deletes_compute_keeps_disks(monkeypatch):
lambda conn, server, log: deleted.append(server.id),
)
monkeypatch.setattr(
"gpu_rent.session.delete_floating_ip",
lambda conn, fip_id, address, log: deleted.append("fip"),
"gpu_rent.session.delete_access_ip",
lambda conn, region, fip_id, address, log: deleted.append("fip"),
)
save_state(
SessionState(