Merge branch 'collectd-4.10' into collectd-5.1
[collectd.git] / src / rrdcached.c
index f53ccad..11c1c6a 100644 (file)
@@ -164,13 +164,20 @@ static int value_list_to_filename (char *buffer, int buffer_len,
 static const char *config_get_string (oconfig_item_t *ci)
 {
   if ((ci->children_num != 0) || (ci->values_num != 1)
-      || (ci->values[0].type != OCONFIG_TYPE_STRING))
+      || ((ci->values[0].type != OCONFIG_TYPE_STRING)
+        && (ci->values[0].type != OCONFIG_TYPE_BOOLEAN)))
   {
     ERROR ("rrdcached plugin: %s expects a single string argument.",
         ci->key);
     return (NULL);
   }
 
+  if (ci->values[0].type == OCONFIG_TYPE_BOOLEAN) {
+    if (ci->values[0].value.boolean)
+      return "true";
+    else
+      return "false";
+  }
   return (ci->values[0].value.string);
 } /* const char *config_get_string */