mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-09-02 01:29:36 +00:00
Implement PATCH /config
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import json
|
||||
import psycopg2 as pg
|
||||
import requests
|
||||
|
||||
@@ -56,22 +55,6 @@ def replication_works(context, master, replica, time_limit):
|
||||
""".format(int(time()), master, replica, time_limit))
|
||||
|
||||
|
||||
def patch_config_with_data(config, data):
|
||||
for name, value in data.items():
|
||||
if isinstance(value, dict):
|
||||
patch_config_with_data(config[name], value)
|
||||
else:
|
||||
config[name] = value
|
||||
|
||||
|
||||
@step('I patch global configuration with {data}')
|
||||
def patch_config(context, data):
|
||||
data = json.loads(data)
|
||||
config = json.loads(context.dcs_ctl.query('config'))
|
||||
patch_config_with_data(config, data)
|
||||
context.dcs_ctl.set('config', json.dumps(config))
|
||||
|
||||
|
||||
@then('Response on GET {url} contains {value} after {timeout:d} seconds')
|
||||
def check_http_response(context, url, value, timeout):
|
||||
for _ in range(int(timeout)):
|
||||
|
||||
Reference in New Issue
Block a user