1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

node: do not re-check node-type in node_parse()

This commit is contained in:
Steffen Vogel 2020-09-10 11:20:58 +02:00
parent 9b5b7b6947
commit 458cfe151c

View file

@ -138,12 +138,11 @@ int node_parse(struct vnode *n, json_t *json, const char *name)
json_error_t err;
json_t *json_netem = nullptr;
const char *type, *uuid = nullptr;
const char *uuid = nullptr;
n->name = strdup(name);
ret = json_unpack_ex(json, &err, 0, "{ s: s, s?: s, s?: b }",
"type", &type,
ret = json_unpack_ex(json, &err, 0, "{ s?: s, s?: b }",
"uuid", &uuid,
"enabled", &enabled
);
@ -162,11 +161,6 @@ int node_parse(struct vnode *n, json_t *json, const char *name)
return ret;
#endif /* __linux__ */
nt = node_type_lookup(type);
assert(nt == node_type(n));
n->_vt = nt;
if (uuid) {
ret = uuid_parse(uuid, n->uuid);
if (ret)