CLI replace_pillar_node_type_schemas: allow setting license types on public project nodes.
This commit is contained in:
parent
295c821b9d
commit
e117432f3d
@ -534,6 +534,7 @@ def replace_pillar_node_type_schemas(proj_url=None, all_projects=False):
|
||||
|
||||
def handle_project(project):
|
||||
log.info('Handling project %s', project['url'])
|
||||
is_public_proj = not project.get('is_private', True)
|
||||
|
||||
for proj_nt in project['node_types']:
|
||||
nt_name = proj_nt['name']
|
||||
@ -549,6 +550,11 @@ def replace_pillar_node_type_schemas(proj_url=None, all_projects=False):
|
||||
# such as permissions.
|
||||
proj_nt.update(copy.deepcopy(pillar_nt))
|
||||
|
||||
# On our own public projects we want to be able to set license stuff.
|
||||
if is_public_proj:
|
||||
proj_nt['form_schema'].pop('license_type', None)
|
||||
proj_nt['form_schema'].pop('license_notes', None)
|
||||
|
||||
# Use Eve to PUT, so we have schema checking.
|
||||
db_proj = remove_private_keys(project)
|
||||
r, _, _, status = put_internal('projects', db_proj, _id=project['_id'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user