~landscape/landscape-charm/ops-framework

« back to all changes in this revision

Viewing changes to src/settings_files.py

  • Committer: Kevin Nasto
  • Date: 2023-03-15 15:59:28 UTC
  • mfrom: (435.2.3 upgrade_action_log)
  • Revision ID: kevin.nasto@canonical.com-20230315155928-ecf46jcm5xlwv5br
Merged add_store_password

Show diffs side-by-side

added added

removed removed

Lines of Context:
161
161
            "Unable to decode b64-encoded SSL certificate")
162
162
 
163
163
 
164
 
def update_db_conf(host=None, password=None, port=DEFAULT_POSTGRES_PORT, user=None):
 
164
def update_db_conf(host=None, password=None, schema_password=None, port=DEFAULT_POSTGRES_PORT,
 
165
                   user=None):
165
166
    """Postgres specific settings override"""
166
167
    to_update = defaultdict(dict)
167
168
    if host:  # Note that host is required if port is changed
169
170
    if password:
170
171
        to_update["stores"]["password"] = password
171
172
        to_update["schema"]["store_password"] = password
 
173
    if schema_password:  # Overrides password
 
174
        to_update["schema"]["store_password"] = schema_password
172
175
    if user:
173
176
        to_update["schema"]["store_user"] = user
174
177
    if to_update: