summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 43d4ef4)
raw | patch | inline | side by side (parent: 43d4ef4)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 26 Dec 2013 13:12:30 +0000 (14:12 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 26 Dec 2013 13:12:30 +0000 (14:12 +0100) |
We don't have any concept of service inheritance (yet?).
Also, I'm not sure if this would ever make sense in general. This might be a
query option, though.
Also, I'm not sure if this would ever make sense in general. This might be a
query option, though.
src/core/store.c | patch | blob | history |
diff --git a/src/core/store.c b/src/core/store.c
index e9e0979e72e4db10ec99d34f2596f178c5d19317..ed5b7ceb5095c683bdb2a3c775c67ff389950ff7 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
/*
* SysDB - src/core/store.c
- * Copyright (C) 2012 Sebastian 'tokkee' Harl <sh@tokkee.org>
+ * Copyright (C) 2012-2013 Sebastian 'tokkee' Harl <sh@tokkee.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
return sobj;
}
+ /* don't lookups non-host types from hierarchical hosts */
+ if ((type != SDB_HOST) && (sobj->type == SDB_HOST))
+ continue;
+
sobj = sdb_store_lookup_in_list(sobj->children, type, name);
if (sobj) {
sdb_llist_iter_destroy(iter);
parent_list = parent->children;
}
- /* TODO: only look into direct children? */
if (type == SDB_HOST)
/* make sure that each host is unique */
old = STORE_OBJ(sdb_store_lookup_in_list(obj_list, type, name));
else if (type == SDB_ATTRIBUTE)
+ /* look into attributes of this host */
old = STORE_OBJ(sdb_llist_search_by_name(parent_list, name));
else
+ /* look into services assigned to this host (sdb_store_lookup_in_list
+ * does not look up services from hierarchical hosts) */
old = STORE_OBJ(sdb_store_lookup_in_list(parent_list, type, name));
if (old) {