diff options
author | sienkiew <sienkiew@d34015c8-bcbb-4646-8ac8-8ba5febf221d> | 2012-06-29 16:46:23 -0400 |
---|---|---|
committer | sienkiew <sienkiew@d34015c8-bcbb-4646-8ac8-8ba5febf221d> | 2012-06-29 16:46:23 -0400 |
commit | 710f3c42d5889dc958debc0267162f38373263c3 (patch) | |
tree | a193e4b271cd1303b86f6123caa25f757b1898e6 | |
parent | 88a280d2d77af6653f99772afee2d925f7624015 (diff) | |
download | steuermann-710f3c42d5889dc958debc0267162f38373263c3.tar.gz |
conditional CMD in TABLE
git-svn-id: https://svn.stsci.edu/svn/ssb/etal/steuermann/trunk@740 d34015c8-bcbb-4646-8ac8-8ba5febf221d
-rw-r--r-- | steuermann/specfile.exy | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/steuermann/specfile.exy b/steuermann/specfile.exy index 73a5b20..f848072 100644 --- a/steuermann/specfile.exy +++ b/steuermann/specfile.exy @@ -47,9 +47,7 @@ parser specfile: name {{ hostlist.append(name) }} | hostgroup {{ hostlist = hostlist + nodes.get_hostgroup( hostgroup ) }} )+ - command_list - # command_list is a list of (command, pos) where command is the text from the file and pos is the location in the file - {{ self.data.add_command_list( table_name, hostlist, command_list ) }} + command_cond<<tablename,hostlist>> + | IMPORT string {{ self.data.import_list.append( string[1:-1] ) }} ## @@ -68,15 +66,9 @@ parser specfile: | hostgroup {{ if accept_nodes : nodes.add_hostgroup( hg, hostgroup ) }} )* - rule command_list: - # one or more commands, appended together into a list - {{ cmlist = [ ] }} - command {{ cmlist.append( command ) }} - [ - command_list {{ cmlist += command_list }} - ] - {{ return cmlist }} - | {{ return [ ] }} + rule command_cond<<table_name,hostlist>> : + IF name COLON command {{ if nodes.check_condition(name, self._scanner.filename ) : self.data.add_command_list( table_name, hostlist, [ command ] ) }} + | command {{ self.data.add_command_list( table_name, hostlist, [ command ] ) }} rule command: # a single command, including any number of AFTER clauses |