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
Collection of json schemas and utpl files used by usync for validating
# ucentral-json-schema
Collection of json schemas and utpl files used by ucentral for validating
the datamodel and rendering incoming cfg json into uci batch sequences.
### Dependencies:
In order to run the test cases you will need the following tools
* utpl
* usync-jsonschema
* ucentral-jsonschema
* jsonlint-php
* pip3 install jsonschema2md
* pip3 install json-schema-for-humans

View File

@@ -65,7 +65,7 @@ for (key in cfg) {
if (key in ["uuid", "ssid"])
continue;
try {
include(sprintf("cfg_%s.tpl", key));
include(sprintf("cfg_%s.uc", key));
} catch (e) {
failed = true;
fails[key] = e;
@@ -75,7 +75,7 @@ for (key in cfg) {
if (failed) {
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();
exit(1);
}

View File

@@ -1,9 +1,9 @@
{%
if (!cmd.url) {
warn("usync-upgrade: invalid FW URL\n");
warn("ucentral-upgrade: invalid FW URL\n");
return;
}
path = "/tmp/usync.upgrade";
path = "/tmp/ucentral.upgrade";
fs.popen(sprintf('wget %s -O %s', cmd.url, path), 'r').close();
ctx = ubus.connect();
@@ -11,8 +11,8 @@
if (!fw.valid) {
ctx = ubus.connect();
ctx.call("usync", "log", {"error": "firmware file validation failed", "data": fw});
warn("usync-upgrade: firmware file validation failed\n");
ctx.call("ucentral", "log", {"error": "firmware file validation failed", "data": fw});
warn("ucentral-upgrade: firmware file validation failed\n");
return;
}
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
./merge-schema.py
mkdir -p docs
jsonschema2md usync.schema.json docs/usync-schema.md
generate-schema-doc usync.schema.json docs/usync-schema.html
jsonschema2md ucentral.schema.json docs/ucentral-schema.md
generate-schema-doc ucentral.schema.json docs/ucentral-schema.html

View File

@@ -3,9 +3,9 @@
import json
merge = {
"$id": "https://openwrt.org/usync.schema.json",
"$id": "https://openwrt.org/ucentral.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "OpenWrt uSync schema",
"description": "OpenWrt uCentral schema",
"type": "object",
"properties": {
"uuid": { "type": "integer" }
@@ -23,10 +23,10 @@ def schema_merge(name, path):
def schema_write():
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)
except:
print("failed to write usync.schema.json")
print("failed to write ucentral.schema.json")
schema_merge("network", "network.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#",
"description": "OpenWrt uSync schema",
"description": "OpenWrt uCentral schema",
"type": "object",
"properties": {
"uuid": {