Commit e67cae73 authored by Matthias's avatar Matthias
Browse files

adapt to new interface of deleteService

parent 2abb8bb3
Pipeline #27967 passed with stages
in 2 minutes and 36 seconds
......@@ -13,10 +13,8 @@ class DeleteService(Resource):
'deleteObject': 'record',
'deleteId': record_id
}
if dryrun:
set_values['dryrun'] = '--dry-run'
try:
self.do_helm_install(set_values, session_id)
self.do_helm_install(set_values, session_id, dryrun)
except Exception as ex:
message = str(ex)
current_app.logger.error(message)
......@@ -30,10 +28,8 @@ class DeleteService(Resource):
'deleteObject': 'record-set',
'deleteId': recordset_id
}
if dryrun:
set_values['dryrun'] = '--dry-run'
try:
self.do_helm_install(set_values, session_id)
self.do_helm_install(set_values, session_id, dryrun)
except Exception as ex:
message = str(ex)
current_app.logger.error(message)
......@@ -47,10 +43,8 @@ class DeleteService(Resource):
'deleteObject': 'institution',
'deleteId': institution_id,
}
if dryrun:
set_values['dryrun'] = '--dry-run'
try:
self.do_helm_install(set_values, session_id)
self.do_helm_install(set_values, session_id, dryrun)
except Exception as ex:
message = str(ex)
current_app.logger.error(message)
......@@ -59,17 +53,25 @@ class DeleteService(Resource):
return 0
@staticmethod
def do_helm_install(set_values, session_id):
def do_helm_install(set_values, session_id, dryrun):
current_app.logger.debug(
'calling delete service: type=' +
set_values['deleteObject'] +
' / id=' + set_values['deleteId'] +
' / session=' + set_values['sessionId'])
jobArgs = [
'--'+set_values['deleteObject']+'-filter',
set_values['deleteId'],
set_values['sessionId']
]
if dryrun:
jobArgs.append('--dry-run')
jobArgs = {'jobArgs': jobArgs}
helm = Helm()
response = helm.install( # noqa: F841
chart=os.path.join(current_app.root_path, "charts", 'import-process-delete'),
name='import-process-delete-' + session_id,
namespace=current_app.config['NAMESPACE'],
set_values=set_values,
set_values=jobArgs,
fail_on_err=False
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment