summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ac66c94)
raw | patch | inline | side by side (parent: ac66c94)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 5 Nov 2014 23:28:00 +0000 (00:28 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 5 Nov 2014 23:28:00 +0000 (00:28 +0100) |
src/core/store_lookup.c | patch | blob | history |
index 94459cb097b1e21526f9c54f65d1cf3cd433c1ca..ffa1346bb1ea9f9bf7ea37b9cdb859cc637addfb 100644 (file)
--- a/src/core/store_lookup.c
+++ b/src/core/store_lookup.c
assert((m->type == MATCHER_ANY) || (m->type == MATCHER_ALL));
- /* TODO: support all object types */
- if (obj->type != SDB_HOST)
- return 0;
-
- if (ITER_M(m)->type == SDB_SERVICE)
- iter = sdb_avltree_get_iter(HOST(obj)->services);
- else if (ITER_M(m)->type == SDB_METRIC)
- iter = sdb_avltree_get_iter(HOST(obj)->metrics);
- else if (ITER_M(m)->type == SDB_ATTRIBUTE)
- iter = sdb_avltree_get_iter(HOST(obj)->attributes);
+ if (obj->type == SDB_HOST) {
+ if (ITER_M(m)->type == SDB_SERVICE)
+ iter = sdb_avltree_get_iter(HOST(obj)->services);
+ else if (ITER_M(m)->type == SDB_METRIC)
+ iter = sdb_avltree_get_iter(HOST(obj)->metrics);
+ else if (ITER_M(m)->type == SDB_ATTRIBUTE)
+ iter = sdb_avltree_get_iter(HOST(obj)->attributes);
+ } else if (obj->type == SDB_SERVICE) {
+ if (ITER_M(m)->type == SDB_ATTRIBUTE)
+ iter = sdb_avltree_get_iter(SVC(obj)->attributes);
+ } else if (obj->type == SDB_METRIC) {
+ if (ITER_M(m)->type == SDB_ATTRIBUTE)
+ iter = sdb_avltree_get_iter(METRIC(obj)->attributes);
+ }
status = all;
while (sdb_avltree_iter_has_next(iter)) {