mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-10-20 18:02:22 +03:00
fix(cloud): keep ports_mapping getter and setter adjacent
This commit is contained in:
parent
a9f5306f16
commit
53aa7ab0d9
@ -202,6 +202,11 @@ class Cloud(BaseNode):
|
||||
|
||||
self._remote_console_http_path = remote_console_http_path
|
||||
|
||||
@staticmethod
|
||||
def _normalize_ports_mapping(ports):
|
||||
# API responses include bridge=None; legacy projects omit it.
|
||||
return [{key: value for key, value in port.items() if key != "bridge" or value is not None} for port in ports]
|
||||
|
||||
@property
|
||||
def ports_mapping(self):
|
||||
"""
|
||||
@ -212,11 +217,6 @@ class Cloud(BaseNode):
|
||||
|
||||
return self._ports_mapping
|
||||
|
||||
@staticmethod
|
||||
def _normalize_ports_mapping(ports):
|
||||
# API responses include bridge=None; legacy projects omit it.
|
||||
return [{key: value for key, value in port.items() if key != "bridge" or value is not None} for port in ports]
|
||||
|
||||
@ports_mapping.setter
|
||||
def ports_mapping(self, ports):
|
||||
"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user