summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f47d818)
raw | patch | inline | side by side (parent: f47d818)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 5 Nov 2014 23:47:16 +0000 (00:47 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 5 Nov 2014 23:47:16 +0000 (00:47 +0100) |
src/frontend/query.c | patch | blob | history |
diff --git a/src/frontend/query.c b/src/frontend/query.c
index 34b35839e03c3d00835e449710f5fffaec5d76fc..6e94f646f2f9d1c20dc2f12dbd30236283dda21a 100644 (file)
--- a/src/frontend/query.c
+++ b/src/frontend/query.c
sdb_store_json_formatter_t *f;
sdb_strbuf_t *buf;
- /* XXX: support other types */
- if (type != SDB_HOST) {
- sdb_log(SDB_LOG_ERR, "frontend: Invalid object type %d "
- "in LOOKUP command", type);
- sdb_strbuf_sprintf(conn->errbuf,
- "LOOKUP: Invalid object type %d", type);
- return -1;
- }
-
buf = sdb_strbuf_create(1024);
if (! buf) {
char errbuf[1024];
sdb_strbuf_memcpy(buf, &res_type, sizeof(uint32_t));
- if (sdb_store_scan(SDB_HOST, m, filter, lookup_tojson, f)) {
- sdb_log(SDB_LOG_ERR, "frontend: Failed to lookup hosts");
- sdb_strbuf_sprintf(conn->errbuf, "Failed to lookup hosts");
+ if (sdb_store_scan(type, m, filter, lookup_tojson, f)) {
+ sdb_log(SDB_LOG_ERR, "frontend: Failed to lookup %ss",
+ SDB_STORE_TYPE_TO_NAME(type));
+ sdb_strbuf_sprintf(conn->errbuf, "Failed to lookup %ss",
+ SDB_STORE_TYPE_TO_NAME(type));
sdb_strbuf_destroy(buf);
free(f);
return -1;