From: Sebastian Harl Date: Thu, 23 Oct 2014 19:28:15 +0000 (+0200) Subject: store: Let sdb_store_parse_object_type_plural support attributes. X-Git-Tag: sysdb-0.6.0~70 X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=commitdiff_plain;h=d362cf356ed21310ecab0fd7f9cc5127880c4ffe 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. --- 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);