Permalink
Browse files

adding @GROUP syntax for GROUPS.yaml

  • Loading branch information...
1 parent 51fabd1 commit c0dc2ad6d49fe94e584ecc7d3626d3a48d4b2fc5 Erik Bourget committed Feb 5, 2013
Showing with 12 additions and 0 deletions.
  1. +12 −0 libcrange/source/functions/yamlfile.c
@@ -71,6 +71,7 @@ static const char* yaml_path = LIBCRANGE_YAML_DIR;
const char** functions_provided(libcrange* lr)
{
static const char* functions[] = {"mem", "cluster", "clusters",
+ "group",
"get_cluster", "get_groups",
"has", "allclusters", 0 };
@@ -608,4 +609,15 @@ range* rangefunc_get_groups(range_request* rr, range** r)
return ret;
}
+range* rangefunc_group(range_request* rr, range** r)
+{
+ range* ret = range_new(rr);
+ apr_pool_t* pool = range_request_pool(rr);
+ const char** groups = range_get_hostnames(pool, r[0]);
+ while (*groups) {
+ range_union_inplace(rr, ret, _expand_cluster(rr, "GROUPS", *groups));
+ ++groups;
+ }
+ return ret;
+}

0 comments on commit c0dc2ad

Please sign in to comment.