CLI replace_pillar_node_type_schemas: abort when unable to save
This commit is contained in:
@@ -560,7 +560,7 @@ def replace_pillar_node_type_schemas(proj_url=None, all_projects=False):
|
|||||||
r, _, _, status = put_internal('projects', db_proj, _id=project['_id'])
|
r, _, _, status = put_internal('projects', db_proj, _id=project['_id'])
|
||||||
if status != 200:
|
if status != 200:
|
||||||
log.error('Error %i storing altered project %s %s', status, project['_id'], r)
|
log.error('Error %i storing altered project %s %s', status, project['_id'], r)
|
||||||
return 4
|
raise SystemExit('Error storing project, see log.')
|
||||||
log.info('Project saved succesfully.')
|
log.info('Project saved succesfully.')
|
||||||
|
|
||||||
if all_projects:
|
if all_projects:
|
||||||
@@ -681,7 +681,7 @@ def upgrade_attachment_schema(proj_url=None, all_projects=False):
|
|||||||
r, _, _, status = put_internal('projects', db_proj, _id=project['_id'])
|
r, _, _, status = put_internal('projects', db_proj, _id=project['_id'])
|
||||||
if status != 200:
|
if status != 200:
|
||||||
log.error('Error %i storing altered project %s %s', status, project['_id'], r)
|
log.error('Error %i storing altered project %s %s', status, project['_id'], r)
|
||||||
return 4
|
raise SystemExit('Error storing project, see log.')
|
||||||
log.info('Project saved succesfully.')
|
log.info('Project saved succesfully.')
|
||||||
|
|
||||||
def replace_attachments(project):
|
def replace_attachments(project):
|
||||||
|
Reference in New Issue
Block a user