docs: Add underscore issue to FAQ
This commit is contained in:
committed by
James Shubin
parent
df9e2e853f
commit
5bc985663c
@@ -254,6 +254,13 @@ prevent masking an error for a situation when you expected a file to already be
|
|||||||
at that location. It also turns out to simplify the internals significantly, and
|
at that location. It also turns out to simplify the internals significantly, and
|
||||||
remove an ambiguous scenario with the reversable file resource.
|
remove an ambiguous scenario with the reversable file resource.
|
||||||
|
|
||||||
|
### Why do function names inside of templates include underscores?
|
||||||
|
|
||||||
|
The golang template library which we use to implement the template() function
|
||||||
|
doesn't support the dot notation, so we import all our normal functions, and
|
||||||
|
just replace dots with underscores. As an example, the standard `datetime.print`
|
||||||
|
function is shown within mcl scripts as datetime_print after being imported.
|
||||||
|
|
||||||
### On startup `mgmt` hangs after: `etcd: server: starting...`.
|
### On startup `mgmt` hangs after: `etcd: server: starting...`.
|
||||||
|
|
||||||
If you get an error message similar to:
|
If you get an error message similar to:
|
||||||
|
|||||||
@@ -5,3 +5,7 @@ file "/tmp/mgmt/datetime" {
|
|||||||
state => $const.res.file.state.exists,
|
state => $const.res.file.state.exists,
|
||||||
content => template("Hello! It is now: {{ datetime_print . }}\n", $d),
|
content => template("Hello! It is now: {{ datetime_print . }}\n", $d),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file "/tmp/mgmt/" {
|
||||||
|
state => $const.res.file.state.exists,
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user