mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +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')):
|
for file in os.listdir(get_resource('appliances')):
|
||||||
with open(os.path.join(get_resource('appliances'), file)) as f:
|
with open(os.path.join(get_resource('appliances'), file)) as f:
|
||||||
appliance = ApplianceTemplate(None, json.load(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
|
@asyncio.coroutine
|
||||||
def start(self):
|
def start(self):
|
||||||
|
@ -31,6 +31,10 @@ class ApplianceTemplate:
|
|||||||
def id(self):
|
def id(self):
|
||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
|
@property
|
||||||
|
def status(self):
|
||||||
|
return self._data["status"]
|
||||||
|
|
||||||
def __json__(self):
|
def __json__(self):
|
||||||
"""
|
"""
|
||||||
Appliance data (a hash)
|
Appliance data (a hash)
|
||||||
|
@ -451,6 +451,8 @@ def test_get_free_project_name(controller, async_run):
|
|||||||
|
|
||||||
def test_appliance_templates(controller):
|
def test_appliance_templates(controller):
|
||||||
assert len(controller.appliance_templates) > 0
|
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):
|
def test_load_base_files(controller, config, tmpdir):
|
||||||
|
Loading…
Reference in New Issue
Block a user