diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index de30bc15..c397d522 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -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): diff --git a/gns3server/controller/appliance_template.py b/gns3server/controller/appliance_template.py index ab89db63..acf66975 100644 --- a/gns3server/controller/appliance_template.py +++ b/gns3server/controller/appliance_template.py @@ -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) diff --git a/tests/controller/test_controller.py b/tests/controller/test_controller.py index b21d78e5..f27b712b 100644 --- a/tests/controller/test_controller.py +++ b/tests/controller/test_controller.py @@ -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):