Better config defaults and remove some unneeded code
This commit is contained in:
parent
40d2b1748f
commit
219730c341
6 changed files with 657 additions and 649 deletions
|
@ -67,11 +67,15 @@ class SuperUserGetConfig(ApiResource):
|
|||
'type': 'object',
|
||||
'description': 'Updates the YAML config file',
|
||||
'required': [
|
||||
'config'
|
||||
'config',
|
||||
'hostname'
|
||||
],
|
||||
'properties': {
|
||||
'config': {
|
||||
'type': 'object'
|
||||
},
|
||||
'hostname': {
|
||||
'type': 'string'
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -102,9 +106,10 @@ class SuperUserGetConfig(ApiResource):
|
|||
# so we also allow it to be called if there is no valid registry configuration setup.
|
||||
if not os.path.exists(OVERRIDE_CONFIG_YAML_FILENAME) or SuperUserPermission().can():
|
||||
config_object = request.get_json()['config']
|
||||
hostname = request.get_json()['hostname']
|
||||
|
||||
# Add any enterprise defaults missing from the config.
|
||||
add_enterprise_config_defaults(config_object, app.config['SECRET_KEY'])
|
||||
add_enterprise_config_defaults(config_object, app.config['SECRET_KEY'], hostname)
|
||||
|
||||
# Write the configuration changes to the YAML file.
|
||||
export_yaml(config_object, OVERRIDE_CONFIG_YAML_FILENAME)
|
||||
|
|
Reference in a new issue