mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-18 20:37:57 +00:00
Do not return broken appliances like ASA 8
This commit is contained in:
parent
21849656d1
commit
99ee40df3d
@ -67,7 +67,8 @@ class Controller:
|
||||
for file in os.listdir(get_resource('appliances')):
|
||||
with open(os.path.join(get_resource('appliances'), file)) as f:
|
||||
appliance = ApplianceTemplate(None, json.load(f))
|
||||
self._appliance_templates[appliance.id] = appliance
|
||||
if appliance.status != 'broken':
|
||||
self._appliance_templates[appliance.id] = appliance
|
||||
|
||||
@asyncio.coroutine
|
||||
def start(self):
|
||||
|
@ -31,6 +31,10 @@ class ApplianceTemplate:
|
||||
def id(self):
|
||||
return self._id
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
return self._data["status"]
|
||||
|
||||
def __json__(self):
|
||||
"""
|
||||
Appliance data (a hash)
|
||||
|
@ -451,6 +451,8 @@ def test_get_free_project_name(controller, async_run):
|
||||
|
||||
def test_appliance_templates(controller):
|
||||
assert len(controller.appliance_templates) > 0
|
||||
for appliance in controller.appliance_templates.values():
|
||||
assert appliance.__json__()["status"] != "broken"
|
||||
|
||||
|
||||
def test_load_base_files(controller, config, tmpdir):
|
||||
|
Loading…
Reference in New Issue
Block a user