-
Notifications
You must be signed in to change notification settings - Fork 18
Semantic Issues regarding Node Inheritance
A node declared as
node default { }
is used for hosts that do not match. Is it possible for such a node to also inherit ?
node default inherits x { }
Is obviously not allowed. Depending on the semantics for inheritance using regular expressions, there can be some surprises that are introduced when additional classes are added (and they happen to match).
Are simple and qualified names allowed to overlap? Is it ok to declare all of these:
node bugtracker { }
node ‘bugtracker.myorg.com’ { }
node ‘bugtracker.internal.myorg.com’ { }
… or is this an error?
A node can be declared with a simple name (e.g. bugtracker), or a fully qualified name (‘bugtracker.myorg.com’). When inheriting it is possible to use both simple and qualified name - what happens when there are several to choose from e.g. ‘bugtracker.myorg.com’, ‘bugtracker.internal.myorg.com’. What happens if a node is declared with:
node x inherits bugtracker { }
A node can match using a regular expression:
node /web-([0-9]*).example.com$/ {}
How is inhertitance of such a node possible? This syntax is allowed by the parser:
node webservers inherits /web-([0-9]*).example.com$/ {}
What does this mean? Is the inheritance to a node with an identical (matching) regexp (i.e. equal regexp string), or to equivalently matching regexps, or it is it applied to the regexp as a string? Or, are nodes defined with regexp ‘name’ not included in the matching?
This is very confusing...
Is this sensical?
node /defa.*/ { }
Since inheritence can be expressed with regular expressions and string expressions - what happens if there is no match? Is this an error, or simply that there is nothing to inherit at this particular moment? If the answer is that it means that same as not having specified inheritance, then does the same rule apply if a name is used? E.g.
- No xyz is known
node a inherits xyz { }- Regexp does not match
node a inherits /x.*/ { }- Variably $y is not set to "yz"
node a inherits "$y"