ucentral: rebrand

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2020-11-27 08:43:02 +01:00
parent 89e079afeb
commit bbae94c564
18 changed files with 17 additions and 17 deletions

View File

@@ -1,11 +1,11 @@
# usync-json-schema # ucentral-json-schema
Collection of json schemas and utpl files used by usync for validating Collection of json schemas and utpl files used by ucentral for validating
the datamodel and rendering incoming cfg json into uci batch sequences. the datamodel and rendering incoming cfg json into uci batch sequences.
### Dependencies: ### Dependencies:
In order to run the test cases you will need the following tools In order to run the test cases you will need the following tools
* utpl * utpl
* usync-jsonschema * ucentral-jsonschema
* jsonlint-php * jsonlint-php
* pip3 install jsonschema2md * pip3 install jsonschema2md
* pip3 install json-schema-for-humans * pip3 install json-schema-for-humans

View File

@@ -65,7 +65,7 @@ for (key in cfg) {
if (key in ["uuid", "ssid"]) if (key in ["uuid", "ssid"])
continue; continue;
try { try {
include(sprintf("cfg_%s.tpl", key)); include(sprintf("cfg_%s.uc", key));
} catch (e) { } catch (e) {
failed = true; failed = true;
fails[key] = e; fails[key] = e;
@@ -75,7 +75,7 @@ for (key in cfg) {
if (failed) { if (failed) {
ctx = ubus.connect(); ctx = ubus.connect();
ctx.call("usync", "log", {"error": "failed to apply config", "data": fails}); ctx.call("ucentral", "log", {"error": "failed to apply config", "data": fails});
ctx.disconnect(); ctx.disconnect();
exit(1); exit(1);
} }

View File

@@ -1,9 +1,9 @@
{% {%
if (!cmd.url) { if (!cmd.url) {
warn("usync-upgrade: invalid FW URL\n"); warn("ucentral-upgrade: invalid FW URL\n");
return; return;
} }
path = "/tmp/usync.upgrade"; path = "/tmp/ucentral.upgrade";
fs.popen(sprintf('wget %s -O %s', cmd.url, path), 'r').close(); fs.popen(sprintf('wget %s -O %s', cmd.url, path), 'r').close();
ctx = ubus.connect(); ctx = ubus.connect();
@@ -11,8 +11,8 @@
if (!fw.valid) { if (!fw.valid) {
ctx = ubus.connect(); ctx = ubus.connect();
ctx.call("usync", "log", {"error": "firmware file validation failed", "data": fw}); ctx.call("ucentral", "log", {"error": "firmware file validation failed", "data": fw});
warn("usync-upgrade: firmware file validation failed\n"); warn("ucentral-upgrade: firmware file validation failed\n");
return; return;
} }
fs.popen(sprintf('/sbin/sysupgrade %s', path), 'r').close(); fs.popen(sprintf('/sbin/sysupgrade %s', path), 'r').close();

View File

@@ -12,5 +12,5 @@ yaml2json schema/wifi-ssid.yml wifi-ssid.schema
yaml2json schema/steer.yml steer.schema yaml2json schema/steer.yml steer.schema
./merge-schema.py ./merge-schema.py
mkdir -p docs mkdir -p docs
jsonschema2md usync.schema.json docs/usync-schema.md jsonschema2md ucentral.schema.json docs/ucentral-schema.md
generate-schema-doc usync.schema.json docs/usync-schema.html generate-schema-doc ucentral.schema.json docs/ucentral-schema.html

View File

@@ -3,9 +3,9 @@
import json import json
merge = { merge = {
"$id": "https://openwrt.org/usync.schema.json", "$id": "https://openwrt.org/ucentral.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "OpenWrt uSync schema", "description": "OpenWrt uCentral schema",
"type": "object", "type": "object",
"properties": { "properties": {
"uuid": { "type": "integer" } "uuid": { "type": "integer" }
@@ -23,10 +23,10 @@ def schema_merge(name, path):
def schema_write(): def schema_write():
try: try:
with open(f"usync.schema.json", 'w') as outfile: with open(f"ucentral.schema.json", 'w') as outfile:
json.dump(merge, outfile, indent=True) json.dump(merge, outfile, indent=True)
except: except:
print("failed to write usync.schema.json") print("failed to write ucentral.schema.json")
schema_merge("network", "network.schema") schema_merge("network", "network.schema")
schema_merge("phy", "wifi-phy.schema") schema_merge("phy", "wifi-phy.schema")

View File

@@ -1,7 +1,7 @@
{ {
"$id": "https://openwrt.org/usync.schema.json", "$id": "https://openwrt.org/ucentral.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "OpenWrt uSync schema", "description": "OpenWrt uCentral schema",
"type": "object", "type": "object",
"properties": { "properties": {
"uuid": { "uuid": {