Make count and append_const actions use set_if in icinga conf

This commit is contained in:
Adam Goldsmith 2022-12-26 17:45:38 -05:00
parent a459b3cdbe
commit b2524c8799

View File

@ -124,7 +124,14 @@ class Icinga2ConfAction(argparse.Action):
if action.required: if action.required:
print(" required = true") print(" required = true")
if isinstance(action, argparse._StoreConstAction): if isinstance(
action,
(
argparse._StoreConstAction,
argparse._CountAction,
argparse._AppendConstAction,
),
):
print(f' set_if = "${command_name}_{icinga2_var}$"') print(f' set_if = "${command_name}_{icinga2_var}$"')
else: else:
print(f' value = "${command_name}_{icinga2_var}$"') print(f' value = "${command_name}_{icinga2_var}$"')