Closed sticky-note closed 4 years ago
@sticky-note Thanks for the PR. Just tracking back through the use of format_kwargs
:
@vutny Can I get your opinion about this?
@Myii hmmmm, you're right. Non-empty strings are evaluated as true
. Is there a way to test the type of a value ?
Tested a salt-call state.show_sls postgres
on this pillar:
postgres:
users:
test_dba:
ensure: present
password: '%=Hec$K8;'
createdb: false
createroles: false
inherit: true
replication: false
It seems that boolean strings are correctly computed in Booleans :
(...)
postgres_user-test_dba:
----------
__env__:
base
__sls__:
postgres.manage
postgres_user:
|_
----------
createdb:
False
|_
----------
createroles:
False
|_
----------
inherit:
True
|_
----------
name:
test_dba
|_
----------
password:
%=Hec$K8;
|_
----------
replication:
False
|_
----------
user:
postgres
|_
----------
onchanges:
|_
----------
test:
postgres-reload-modules
- present
|_
----------
order:
10011
(...)
I think it's because format_kwargs
is never called directly but not sure at all
Best reviewed: commit by commit
Powered by Pull Assistant. Last update 5e6511b ... 5e6511b. Read the comment docs.
@myii @vutny Is that better like that ?
What about this PR @vutny @myii ? :)
@sticky-note Did you test this out first?
@myii
| quote
doesn't work with :
in strings for example.
| yaml_dquote
has better escaping power and encapsulate into "
like I wanted
Merged, thanks @sticky-note -- apologies for the delay.
@myii No problem, I didn't have so much time too ;)
:tada: This PR is included in version 0.41.2 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[build]
Changes related to the build system[chore]
Changes to the build process or auxiliary tools and libraries such as documentation generation[ci]
Changes to the continuous integration configuration[feat]
A new feature[fix]
A bug fix[perf]
A code change that improves performance[refactor]
A code change that neither fixes a bug nor adds a feature[revert]
A change used to revert a previous commit[style]
Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)Secondary type
[docs]
Documentation changes[test]
Adding missing or correcting existing testsDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
Quote kwargs values on
format_kwargs
macro to resolve sls rendering failure on special characters :Describe the changes you're proposing
Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
Documentation checklist
README
(e.g.Available states
).pillar.example
.Testing checklist
state_top
).Additional context