Ignore case for yadm.distro and .distro_family in default template
Same as b2b0b14
but for if statements in default template processor.
This commit is contained in:
parent
b2b0b143d6
commit
18d5f66542
3 changed files with 8 additions and 4 deletions
|
@ -86,7 +86,7 @@ wrong user 2
|
|||
{{% if yadm.distro == "wrongdistro1" %}}
|
||||
wrong distro 1
|
||||
{{% endif %}}
|
||||
{{% if yadm.distro == "{LOCAL_DISTRO}" %}}
|
||||
{{% if yadm.distro == "{LOCAL_DISTRO.upper()}" %}}
|
||||
Included section for distro = {{{{yadm.distro}}}} ({{{{yadm.distro}}}} again)
|
||||
{{% endif %}}
|
||||
{{% if yadm.distro == "wrongdistro2" %}}
|
||||
|
@ -95,7 +95,7 @@ wrong distro 2
|
|||
{{% if yadm.distro_family == "wrongfamily1" %}}
|
||||
wrong family 1
|
||||
{{% endif %}}
|
||||
{{% if yadm.distro_family == "{LOCAL_DISTRO_FAMILY}" %}}
|
||||
{{% if yadm.distro_family == "{LOCAL_DISTRO_FAMILY.upper()}" %}}
|
||||
Included section for distro_family = \
|
||||
{{{{yadm.distro_family}}}} ({{{{yadm.distro_family}}}} again)
|
||||
{{% endif %}}
|
||||
|
|
4
yadm
4
yadm
|
@ -363,6 +363,10 @@ BEGIN {
|
|||
if (rhs == cls_array[idx]) { lhs = rhs; break }
|
||||
}
|
||||
}
|
||||
else if (lhs == "yadm.distro" || lhs == "yadm.distro_family") {
|
||||
lhs = tolower(replace_vars("{{" lhs "}}"))
|
||||
rhs = tolower(rhs)
|
||||
}
|
||||
else {
|
||||
lhs = replace_vars("{{" lhs "}}")
|
||||
}
|
||||
|
|
4
yadm.1
4
yadm.1
|
@ -502,14 +502,14 @@ See the CONFIGURATION section for more details about setting
|
|||
.BR local.class .
|
||||
.TP
|
||||
.BR distro , " d
|
||||
Valid if the value matches the distro.
|
||||
Valid if the value matches the distro (ignoring case).
|
||||
Distro is calculated by running
|
||||
.B "lsb_release -si"
|
||||
or by inspecting the ID from
|
||||
.BR "/etc/os-release" .
|
||||
.TP
|
||||
.BR distro_family , " f
|
||||
Valid if the value matches the distro family.
|
||||
Valid if the value matches the distro family (ignoring case).
|
||||
Distro family is calculated by inspecting the ID_LIKE line from
|
||||
.BR "/etc/os-release" .
|
||||
.TP
|
||||
|
|
Loading…
Reference in a new issue