Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix of 67377: postgresql_set converts value to uppercase if "mb" or "gb" or "tb" is in the value string #67418

Merged
merged 3 commits into from Feb 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,2 @@
bugfixes:
- postgresql_set - fix converting value to uppercase (https://github.com/ansible/ansible/issues/67377).
2 changes: 1 addition & 1 deletion lib/ansible/modules/database/postgresql/postgresql_set.py
Expand Up @@ -299,7 +299,7 @@ def main():
# Allow to pass values like 1mb instead of 1MB, etc:
if value:
for unit in POSSIBLE_SIZE_UNITS:
if unit in value:
if value[:-2].isdigit() and unit in value[-2:]:
value = value.upper()

if value and reset:
Expand Down
Expand Up @@ -69,7 +69,7 @@
postgresql_set:
<<: *pg_parameters
name: work_mem
value: 12MB
value: 12mb
register: set_wm

- assert:
Expand Down Expand Up @@ -281,3 +281,24 @@
- set_aut.changed == false
- set_aut.restart_required == false
- set_aut.value.value == 'off'

#################
# Bugfix of 67377
- name: archive command with mb
<<: *task_parameters
postgresql_set:
<<: *pg_parameters
name: archive_command
value: 'test ! -f /mnt/postgres/mb/%f && cp %p /mnt/postgres/mb/%f'

# Check:
- name: check value
<<: *task_parameters
postgresql_query:
<<: *pg_parameters
query: select reset_val from pg_settings where name = 'archive_command'
register: result

- assert:
that:
- result.query_result.0.reset_val == "test ! -f /mnt/postgres/mb/%f && cp %p /mnt/postgres/mb/%f"