From b6429f5a2f9c3ebb5726cfdb6cc065531b51dbb4 Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 5 Oct 2020 22:51:44 +0800 Subject: [PATCH] Revert "Add config-2.0.json" This reverts commit 1c1872c1 --- avalon/inventory.py | 20 +-------- avalon/schema/config-2.0.json | 85 ----------------------------------- 2 files changed, 1 insertion(+), 104 deletions(-) delete mode 100644 avalon/schema/config-2.0.json diff --git a/avalon/inventory.py b/avalon/inventory.py index 59d3ca6e1..a33dc126e 100644 --- a/avalon/inventory.py +++ b/avalon/inventory.py @@ -146,8 +146,7 @@ def save(name, config, inventory): handlers = { "avalon-core:inventory-1.0": _save_inventory_1_0, - "avalon-core:config-1.0": _save_config_1_0, - "avalon-core:config-2.0": _save_config_2_0, + "avalon-core:config-1.0": _save_config_1_0 } for data in (inventory, config): @@ -341,23 +340,6 @@ def _save_config_1_0(project_name, data): io.replace_one(_filter, document) -def _save_config_2_0(project_name, data): - _filter = {"type": "project"} - - document = io.find_one(_filter) - - config = document["config"] - - config["tasks"] = data.get("tasks", []) - config["template"].update(data.get("template", {})) - config["families"] = data.get("families", []) - config["groups"] = data.get("groups", []) - - schema.validate(document) - - io.replace_one(_filter, document) - - def _report(added, updated): if added: print("+ added:") diff --git a/avalon/schema/config-2.0.json b/avalon/schema/config-2.0.json deleted file mode 100644 index 58d360861..000000000 --- a/avalon/schema/config-2.0.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - - "title": "avalon-core:config-2.0", - "description": "A project configuration.", - - "type": "object", - - "additionalProperties": false, - "required": [ - "template", - "tasks" - ], - - "properties": { - "schema": { - "description": "Schema identifier for payload", - "type": "string" - }, - "template": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^.*$": { - "type": "string" - } - } - }, - "tasks": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": {"type": "string"}, - "icon": {"type": "string"}, - "group": {"type": "string"}, - "label": {"type": "string"} - }, - "required": ["name"] - } - }, - "apps": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": {"type": "string"}, - "icon": {"type": "string"}, - "group": {"type": "string"}, - "label": {"type": "string"} - }, - "required": ["name"] - } - }, - "families": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": {"type": "string"}, - "icon": {"type": "string"}, - "label": {"type": "string"}, - "hideFilter": {"type": "boolean"} - }, - "required": ["name"] - } - }, - "groups": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": {"type": "string"}, - "icon": {"type": "string"}, - "color": {"type": "string"}, - "order": {"type": ["integer", "number"]} - }, - "required": ["name"] - } - }, - "copy": { - "type": "object" - } - } -}