From 34e312010c9fddd400cb9102312c8fabe649a0ec Mon Sep 17 00:00:00 2001 From: sienkiew Date: Fri, 22 Jun 2012 17:00:28 +0000 Subject: defining a hostgroup defaults it to blank, even if no IF matches git-svn-id: https://svn.stsci.edu/svn/ssb/etal/steuermann/trunk@730 d34015c8-bcbb-4646-8ac8-8ba5febf221d --- steuermann/nodes.py | 4 +++- steuermann/specfile.exy | 3 ++- 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 {{ nodes.define_hostgroup( hostgroup) }} + ( hostgroup_if<> )+ rule hostgroup_if<> : IF name -- cgit