aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--steuermann/nodes.py4
-rw-r--r--steuermann/specfile.exy3
2 files changed, 5 insertions, 2 deletions
diff --git a/steuermann/nodes.py b/steuermann/nodes.py
index 51f3264..bd273bf 100644
--- a/steuermann/nodes.py
+++ b/steuermann/nodes.py
@@ -395,9 +395,11 @@ def check_condition( name, filename ) :
hostgroups = { }
-def add_hostgroup( name, host ) :
+def define_hostgroup( name ) :
if not name in hostgroups :
hostgroups[name] = [ ]
+
+def add_hostgroup( name, host ) :
if host.startswith('@') :
new = get_hostgroup(host)
else :
diff --git a/steuermann/specfile.exy b/steuermann/specfile.exy
index c813080..4353069 100644
--- a/steuermann/specfile.exy
+++ b/steuermann/specfile.exy
@@ -54,7 +54,8 @@ parser specfile:
##
rule hostgroup_def :
- HOSTGROUP hostgroup ( hostgroup_if<<hostgroup>> )+
+ HOSTGROUP hostgroup {{ nodes.define_hostgroup( hostgroup) }}
+ ( hostgroup_if<<hostgroup>> )+
rule hostgroup_if<<hg>> :
IF name