summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 914549b)
raw | patch | inline | side by side (parent: 914549b)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 3 Nov 2014 06:28:28 +0000 (07:28 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 3 Nov 2014 06:28:28 +0000 (07:28 +0100) |
src/frontend/query.c | patch | blob | history | |
t/integration/query.sh | patch | blob | history |
diff --git a/src/frontend/query.c b/src/frontend/query.c
index 1cb32dd307098f1290f011f3f83104bf97a5604b..e9c2d2212965638bf74dbbfd57e7ef3c1e72ca25 100644 (file)
--- a/src/frontend/query.c
+++ b/src/frontend/query.c
}
host = sdb_store_get_host(name);
- if (! host) {
+ if ((! host) || (filter
+ && (! sdb_store_matcher_matches(filter, host, NULL)))) {
sdb_log(SDB_LOG_DEBUG, "frontend: Failed to fetch host '%s': "
"not found", name);
diff --git a/t/integration/query.sh b/t/integration/query.sh
index e034e7c1d697e1694cb14e849885037832b5a706..39522cf9be6c09928952f121b621b6121286e54a 100755 (executable)
--- a/t/integration/query.sh
+++ b/t/integration/query.sh
echo "$output" | grep -F 'other.host.name' && exit 1
echo "$output" | grep -F 'some.host.name' && exit 1
+output="$( run_sysdb -H "$SOCKET_FILE" \
+ -c "FETCH host 'host1.example.com' FILTER last_update < 0" )" \
+ && exit 1
+echo "$output" | grep -F 'not found'
+
(echo 'LIST hosts;'; sleep 1; echo "FETCH host 'host1.example.com'") \
| run_sysdb -H "$SOCKET_FILE"