From d362cf356ed21310ecab0fd7f9cc5127880c4ffe Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 23 Oct 2014 21:28:15 +0200 Subject: [PATCH] store: Let sdb_store_parse_object_type_plural support attributes. However, the parser will not accept attributes in LIST commands as before. Still, an attribute is considered to be a stored object. --- src/core/store_lookup.c | 2 ++ src/frontend/grammar.y | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/store_lookup.c b/src/core/store_lookup.c index 7b2dcd6..9c2a68d 100644 --- a/src/core/store_lookup.c +++ b/src/core/store_lookup.c @@ -795,6 +795,8 @@ sdb_store_parse_object_type_plural(const char *name) return SDB_SERVICE; else if (! strcasecmp(name, "metrics")) return SDB_METRIC; + else if (! strcasecmp(name, "attributes")) + return SDB_ATTRIBUTE; return -1; } /* sdb_store_parse_object_type_plural */ diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y index 722796c..435b247 100644 --- a/src/frontend/grammar.y +++ b/src/frontend/grammar.y @@ -293,7 +293,7 @@ list_statement: LIST IDENTIFIER filter_clause { int type = sdb_store_parse_object_type_plural($2); - if (type < 0) { + if ((type < 0) || (type == SDB_ATTRIBUTE)) { char errmsg[strlen($2) + 32]; snprintf(errmsg, sizeof(errmsg), YY_("unknown data-source %s"), $2); -- 2.30.2