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:
parent
9b5b7b6947
commit
458cfe151c
1 changed files with 2 additions and 8 deletions
10
lib/node.cpp
10
lib/node.cpp
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue