parent
addee0699e
commit
a1a624b150
3 changed files with 12 additions and 0 deletions
3
changelogs/fragments/32174-normalize-None-quote.yml
Normal file
3
changelogs/fragments/32174-normalize-None-quote.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
bugfixes:
|
||||
- quote filter - normalize how ``None`` is handled, to match Python3 behavior
|
||||
(https://github.com/ansible/ansible/issues/32174)
|
|
@ -110,6 +110,8 @@ def strftime(string_format, second=None):
|
|||
|
||||
def quote(a):
|
||||
''' return its argument quoted for shell usage '''
|
||||
if a is None:
|
||||
a = u''
|
||||
return shlex_quote(to_text(a))
|
||||
|
||||
|
||||
|
|
|
@ -601,3 +601,10 @@
|
|||
bar: 123
|
||||
thing_items: '{{ thing_dict.items() }}'
|
||||
thing_range: '{{ range(10) }}'
|
||||
|
||||
- name: Assert that quote works on None
|
||||
assert:
|
||||
that:
|
||||
- thing|quote == "''"
|
||||
vars:
|
||||
thing: null
|
||||
|
|
Loading…
Reference in a new issue