Merge ~hemanth-n/postgresql-charm:lp1956266 into postgresql-charm:master

Proposed by Hemanth Nakkina
Status: Superseded
Proposed branch: ~hemanth-n/postgresql-charm:lp1956266
Merge into: postgresql-charm:master
Diff against target: 36 lines (+5/-2)
2 files modified
reactive/postgresql/postgresql.py (+1/-1)
unit_tests/test_postgresql.py (+4/-1)
Reviewer Review Type Date Requested Status
Canonical IS Reviewers Pending
PostgreSQL Charm Maintainers Pending
Review via email: mp+413842@code.launchpad.net

This proposal has been superseded by a proposal from 2022-01-11.

Commit message

Fix regex to read extra_pg_config with dot in configuration parameters

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Tom Haddon (mthaddon) wrote :

Could we split this into a few different merge proposals, since there's the addition of data_sync_retry to pg_settings_10.json, some description changes/typo fixes, and extension_destdir addition in pg_settings_11.json which I think should be handled in a separate commit as they're unrelated to the dot configuration parameters and addition of pgaudit settings.

Unmerged commits

e0011ae... by Hemanth Nakkina

Fix regex to read extra_pg_config with dot

Fix regex to include parsing of dot in extra_pg_config
option.

Closes-Bug: #1956266

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/reactive/postgresql/postgresql.py b/reactive/postgresql/postgresql.py
2index 7c5f440..c20705e 100644
3--- a/reactive/postgresql/postgresql.py
4+++ b/reactive/postgresql/postgresql.py
5@@ -614,7 +614,7 @@ def parse_config(unparsed_config, fatal=True):
6 r"""^\s*
7 ( # key=value (1)
8 (?:
9- (\w+) # key (2)
10+ ([.\w]+) # key (2)
11 (?:\s*=\s*|\s+) # separator
12 )?
13 (?:
14diff --git a/unit_tests/test_postgresql.py b/unit_tests/test_postgresql.py
15index 9989318..c6ac803 100644
16--- a/unit_tests/test_postgresql.py
17+++ b/unit_tests/test_postgresql.py
18@@ -580,6 +580,8 @@ class TestPostgresql(unittest.TestCase):
19 service_reload.assert_called_once_with('postgresql@9.9-main')
20
21 def test_parse_config(self):
22+ dict_key_with_dot = dict()
23+ dict_key_with_dot['key.10'] = '-1'
24 valid = [(r'# A comment', dict()),
25 (r'key_1 = value', dict(key_1='value')),
26 (r"key_2 ='quoted valu3'", dict(key_2='quoted valu3')),
27@@ -591,7 +593,8 @@ class TestPostgresql(unittest.TestCase):
28 (r"key_6='#'", dict(key_6='#')),
29 (r"key_7=42", dict(key_7='42')),
30 (r"key_8=3.142", dict(key_8='3.142')),
31- (r'key_9=-1', dict(key_9='-1'))]
32+ (r'key_9=-1', dict(key_9='-1')),
33+ (r'key.10=-1', dict_key_with_dot)]
34
35 # The above examples all parse correctly.
36 for raw, expected in valid:

Subscribers

People subscribed via source and target branches

to all changes: