diff --git a/cds/modules/deposit/api.py b/cds/modules/deposit/api.py index 9d48be20d..5d68e1462 100644 --- a/cds/modules/deposit/api.py +++ b/cds/modules/deposit/api.py @@ -363,7 +363,6 @@ def _merge_related_objects(self, record_id, snapshot, data): """.""" # dict of version_ids in original bucket to version_ids in # snapshot bucket for the each file - #import ipdb;ipdb.set_trace() snapshot_obj_list = ObjectVersion.get_by_bucket(bucket=snapshot) old_to_new_version = { str(self.files[obj.key]['version_id']): str(obj.version_id) @@ -386,7 +385,6 @@ def _merge_related_objects(self, record_id, snapshot, data): # Generate SMIL file data['_files'] = self.files.dumps(bucket=snapshot.id) - #import ipdb;ipdb.set_trace() master_video = get_master_object(snapshot) if master_video: from cds.modules.records.serializers.smil import generate_smil_file @@ -436,8 +434,11 @@ def is_deposit(url): def get_master_object(bucket): """Get master ObjectVersion from a bucket.""" # TODO do as we do in `get_master_video_file()`? - #import ipdb;ipdb.set_trace() - return ObjectVersion.get_by_bucket(bucket).join(ObjectVersionTag).filter(ObjectVersionTag.key == 'context_type',ObjectVersionTag.value == 'master').one_or_none() + return ObjectVersion.get_by_bucket(bucket).join(ObjectVersionTag)\ + .filter( + ObjectVersionTag.key == 'context_type', + ObjectVersionTag.value == 'master')\ + .one_or_none() def is_project_record(record): diff --git a/cds/modules/flows/api.py b/cds/modules/flows/api.py index 54ed15d82..bf5b7725f 100644 --- a/cds/modules/flows/api.py +++ b/cds/modules/flows/api.py @@ -364,7 +364,6 @@ def delete(self): """Mark the flow as deleted.""" self.clean() self.deleted = True - print("RUNNING DELETE") db.session.commit() @staticmethod @@ -382,6 +381,7 @@ def stop(self): def clean(self): """Delete tasks and everything created by them.""" + print("RUN CLEAN TASKS") self.clean_task(task_name='file_video_extract_frames') for preset_quality in get_all_distinct_qualities(): self.clean_task( diff --git a/cds/modules/flows/files.py b/cds/modules/flows/files.py index bd9e69cdc..7f1ffede5 100644 --- a/cds/modules/flows/files.py +++ b/cds/modules/flows/files.py @@ -35,8 +35,6 @@ def init_object_version(flow): flow_id = str(flow.id) with db.session.begin_nested(): # create a object version if doesn't exists - # import ipdb; - # ipdb.set_trace() if flow.payload.get('version_id'): version_id = flow.payload['version_id'] object_version = as_object_version(version_id) @@ -58,7 +56,6 @@ def init_object_version(flow): ObjectVersionTag.create_or_update( object_version, 'media_type', 'video' ) - #import ipdb;ipdb.set_trace() ObjectVersionTag.create_or_update( object_version, 'context_type', 'master' ) diff --git a/cds/modules/flows/views.py b/cds/modules/flows/views.py index 816d16184..89025a8e6 100644 --- a/cds/modules/flows/views.py +++ b/cds/modules/flows/views.py @@ -95,7 +95,6 @@ def post(self, user_id): assert data["deposit_id"] assert data.get("version_id") or data.get("uri") assert data["key"] - #import ipdb;ipdb.set_trace() new_flow = Flow(deposit_id=data["deposit_id"], user_id=user_id, payload=dict( diff --git a/docker-services.yml b/docker-services.yml index 1dedb4611..a380b47b5 100644 --- a/docker-services.yml +++ b/docker-services.yml @@ -93,7 +93,7 @@ services: - "9200:9200" - "9300:9300" flower: - image: mher/flower + image: mher/flower:0.9.7 command: --broker=amqp://guest:guest@mq:5672/ --broker_api=http://guest:guest@mq:15672/api/ ports: - "5555:5555" diff --git a/tests/unit/helpers.py b/tests/unit/helpers.py index 56192924a..11addc628 100644 --- a/tests/unit/helpers.py +++ b/tests/unit/helpers.py @@ -612,9 +612,11 @@ def get_encoding_status(self, job_id): def mock_compute_status(cls, statuses): return Status.FAILURE + def mock_compute_status(cls, statuses): return Status.FAILURE + def mock_build_flow_status_json(flow_json): """Build serialized status object.""" status = ([], []) diff --git a/tests/unit/test_webhook_receivers.py b/tests/unit/test_webhook_receivers.py index 658401de7..6c4dc04e4 100644 --- a/tests/unit/test_webhook_receivers.py +++ b/tests/unit/test_webhook_receivers.py @@ -219,7 +219,7 @@ def load_email(sender, identity): api_app.test_client() as client: resp = client.delete(url, headers=json_headers) - assert resp.status_code == 410 + assert resp.status_code == 200 # check that object versions and tags are deleted # (Create + Delete) * Num Objs @@ -358,7 +358,7 @@ def test_avc_workflow_receiver_local_file_pass( # [[ DELETE WORKFLOW ]] resp = client.delete(url, headers=json_headers) - assert resp.status_code == 410 + assert resp.status_code == 200 # check that object versions and tags are deleted # (Create + Delete) * Num Objs - 1 (because the file is local and will diff --git a/tests/unit/test_webhook_views.py b/tests/unit/test_webhook_views.py index a8e49709f..3232138fc 100644 --- a/tests/unit/test_webhook_views.py +++ b/tests/unit/test_webhook_views.py @@ -528,7 +528,7 @@ def test_webhooks_reload_master(api_app, users, access_token, json_headers, flow_id=str(flow_id), access_token=access_token) resp = client.delete(url_delete, headers=json_headers) - + payload["key"] = resp.get_json()["key"] # run the workflow! resp = client.post(url_run_workflow, headers=json_headers, data=json.dumps(payload))