Skip to content

Commit 5a321bd

Browse files
[DPE-8997] Handle parameters with hyphen (#48)
* Handle parameters with hyphen We forgot that we need to split parameters by hyphen when the config option follows the new format * Fix indentation issues in postgresql.py * Update library version Signed-off-by: Marcelo Henrique Neppel <[email protected]> --------- Signed-off-by: Marcelo Henrique Neppel <[email protected]> Co-authored-by: onkolahmet <[email protected]>
1 parent 1313241 commit 5a321bd

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[project]
55
name = "postgresql-charms-single-kernel"
66
description = "Shared and reusable code for PostgreSQL-related charms"
7-
version = "16.1.3"
7+
version = "16.1.4"
88
readme = "README.md"
99
license = {file = "LICENSE"}
1010
authors = [

single_kernel_postgresql/utils/postgresql.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,9 +1731,15 @@ def build_postgresql_parameters(
17311731
"vacuum",
17321732
)):
17331733
continue
1734-
parameter = "_".join(config.split("_")[1:])
1734+
if "-" in config:
1735+
parameter = "_".join(config.split("-")[1:])
1736+
else:
1737+
parameter = "_".join(config.split("_")[1:])
17351738
if parameter in ["date_style", "time_zone"]:
1736-
parameter = "".join(x.capitalize() for x in parameter.split("_"))
1739+
if "-" in config:
1740+
parameter = "".join(x.capitalize() for x in parameter.split("-"))
1741+
else:
1742+
parameter = "".join(x.capitalize() for x in parameter.split("_"))
17371743
parameters[parameter] = value
17381744
shared_buffers_max_value_in_mb = int(available_memory * 0.4 / 10**6)
17391745
shared_buffers_max_value = int(shared_buffers_max_value_in_mb * 10**3 / 8)

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)