diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y
index 58363df01dbebe37b861394f09632d47397b850a..129b4613009c9d5fc12aa71d2a470c0b02feed31 100644 (file)
--- a/src/frontend/grammar.y
+++ b/src/frontend/grammar.y
list_statement:
LIST IDENTIFIER filter_clause
{
- /* TODO: support other types as well */
- if (strcasecmp($2, "hosts")) {
+ int type = sdb_store_parse_object_type_plural($2);
+ if (type < 0) {
char errmsg[strlen($2) + 32];
snprintf(errmsg, sizeof(errmsg),
YY_("unknown data-source %s"), $2);
$$ = SDB_CONN_NODE(sdb_object_create_dT(/* name = */ NULL,
conn_list_t, conn_list_destroy));
+ CONN_LIST($$)->type = type;
CONN_LIST($$)->filter = CONN_MATCHER($3);
$$->cmd = CONNECTION_LIST;
free($2); $2 = NULL;