diff --git a/lta/bundler.py b/lta/bundler.py index c61121e..a37b2be 100644 --- a/lta/bundler.py +++ b/lta/bundler.py @@ -286,6 +286,7 @@ async def _quarantine_bundle(self, self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.') right_now = now() patch_body = { + "original_status": bundle["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}", "work_priority_timestamp": right_now, diff --git a/lta/deleter.py b/lta/deleter.py index 394805f..f2c3730 100644 --- a/lta/deleter.py +++ b/lta/deleter.py @@ -129,6 +129,7 @@ async def _quarantine_bundle(self, self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.') right_now = now() patch_body = { + "original_status": bundle["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}", "work_priority_timestamp": right_now, diff --git a/lta/desy_move_verifier.py b/lta/desy_move_verifier.py index 6b2c58f..98d2595 100644 --- a/lta/desy_move_verifier.py +++ b/lta/desy_move_verifier.py @@ -114,6 +114,7 @@ async def _quarantine_bundle(self, self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.') right_now = now() patch_body = { + "original_status": bundle["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}", "work_priority_timestamp": right_now, diff --git a/lta/desy_verifier.py b/lta/desy_verifier.py index 79b8802..021663b 100644 --- a/lta/desy_verifier.py +++ b/lta/desy_verifier.py @@ -108,6 +108,7 @@ async def _do_work_claim(self) -> bool: bundle_id = bundle["uuid"] right_now = now() patch_body = { + "original_status": bundle["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:Exception during execution: {e}", "work_priority_timestamp": right_now, diff --git a/lta/gridftp_replicator.py b/lta/gridftp_replicator.py index def105a..d6be8fe 100644 --- a/lta/gridftp_replicator.py +++ b/lta/gridftp_replicator.py @@ -126,6 +126,7 @@ async def _quarantine_bundle(self, self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.') right_now = now() patch_body = { + "original_status": bundle["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}", "work_priority_timestamp": right_now, diff --git a/lta/locator.py b/lta/locator.py index aa66f86..83d1b90 100644 --- a/lta/locator.py +++ b/lta/locator.py @@ -231,6 +231,7 @@ async def _quarantine_transfer_request(self, self.logger.error(f'Sending TransferRequest {tr["uuid"]} to quarantine: {reason}.') right_now = now() patch_body = { + "original_status": tr["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}", "work_priority_timestamp": right_now, diff --git a/lta/nersc_mover.py b/lta/nersc_mover.py index df28ed8..05aa13d 100644 --- a/lta/nersc_mover.py +++ b/lta/nersc_mover.py @@ -122,6 +122,7 @@ async def _do_work_claim(self) -> bool: bundle_id = bundle["uuid"] right_now = now() patch_body = { + "original_status": bundle["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:Exception during execution: {e}", "work_priority_timestamp": right_now, diff --git a/lta/nersc_retriever.py b/lta/nersc_retriever.py index 2845939..2777388 100644 --- a/lta/nersc_retriever.py +++ b/lta/nersc_retriever.py @@ -171,6 +171,7 @@ async def _execute_hsi_command(self, lta_rc: RestClient, bundle: BundleType, arg bundle_id = bundle["uuid"] right_now = now() patch_body = { + "original_status": bundle["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:hsi Command Failed - {completed_process.args} - {completed_process.returncode} - {str(completed_process.stdout)} - {str(completed_process.stderr)}", "work_priority_timestamp": right_now, diff --git a/lta/nersc_verifier.py b/lta/nersc_verifier.py index 51187c6..ad8c1e4 100644 --- a/lta/nersc_verifier.py +++ b/lta/nersc_verifier.py @@ -129,6 +129,7 @@ async def _do_work_claim(self) -> bool: bundle_uuid = bundle["uuid"] right_now = now() patch_body = { + "original_status": bundle["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:Exception during execution: {e}", "work_priority_timestamp": right_now, diff --git a/lta/picker.py b/lta/picker.py index 15edffc..2900891 100644 --- a/lta/picker.py +++ b/lta/picker.py @@ -228,6 +228,7 @@ async def _quarantine_transfer_request(self, self.logger.error(f'Sending TransferRequest {tr["uuid"]} to quarantine: {reason}.') right_now = now() patch_body = { + "original_status": tr["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}", "work_priority_timestamp": right_now, diff --git a/lta/rate_limiter.py b/lta/rate_limiter.py index c5881d7..caf9cc2 100644 --- a/lta/rate_limiter.py +++ b/lta/rate_limiter.py @@ -142,6 +142,7 @@ async def _quarantine_bundle(self, self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.') right_now = now() patch_body = { + "original_status": bundle["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}", "work_priority_timestamp": right_now, diff --git a/lta/site_move_verifier.py b/lta/site_move_verifier.py index 4a104f0..d7a560a 100644 --- a/lta/site_move_verifier.py +++ b/lta/site_move_verifier.py @@ -152,6 +152,7 @@ async def _quarantine_bundle(self, self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.') right_now = now() patch_body = { + "original_status": bundle["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}", "work_priority_timestamp": right_now, diff --git a/lta/unpacker.py b/lta/unpacker.py index 60b3b41..3525cd4 100644 --- a/lta/unpacker.py +++ b/lta/unpacker.py @@ -280,6 +280,7 @@ async def _quarantine_bundle(self, self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.') right_now = now() patch_body = { + "original_status": bundle["status"], "status": "quarantined", "reason": f"BY:{self.name}-{self.instance_uuid} REASON:{reason}", "work_priority_timestamp": right_now, diff --git a/requirements-dev.txt b/requirements-dev.txt index 3770c2b..4dadddc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,18 +5,20 @@ # pip-compile --extra=dev --output-file=requirements-dev.txt # backoff==2.2.1 - # via opentelemetry-exporter-otlp-proto-http + # via + # opentelemetry-exporter-otlp-proto-common + # opentelemetry-exporter-otlp-proto-http binpacking==1.5.2 # via lta (setup.py) cachetools==5.3.1 # via wipac-rest-tools -certifi==2023.5.7 +certifi==2023.7.22 # via requests cffi==1.15.1 # via cryptography -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 # via requests -click==8.1.3 +click==8.1.7 # via # click-completion # pycycle @@ -28,21 +30,21 @@ colorama==0.4.6 # lta (setup.py) coloredlogs==15.0.1 # via wipac-telemetry -coverage[toml]==7.2.7 +coverage[toml]==7.3.1 # via pytest-cov crayons==0.4.0 # via pycycle -cryptography==41.0.1 +cryptography==41.0.3 # via pyjwt deprecated==1.2.14 # via # opentelemetry-api # opentelemetry-exporter-otlp-proto-http -dnspython==2.3.0 +dnspython==2.4.2 # via pymongo -exceptiongroup==1.1.1 +exceptiongroup==1.1.3 # via pytest -flake8==6.0.0 +flake8==6.1.0 # via lta (setup.py) future==0.18.3 # via binpacking @@ -50,7 +52,7 @@ googleapis-common-protos==1.56.2 # via # opentelemetry-exporter-jaeger-proto-grpc # opentelemetry-exporter-otlp-proto-http -grpcio==1.54.2 +grpcio==1.57.0 # via opentelemetry-exporter-jaeger-proto-grpc humanfriendly==10.0 # via coloredlogs @@ -58,7 +60,7 @@ hurry-filesize==0.9 # via lta (setup.py) idna==3.4 # via requests -importlib-metadata==6.0.1 +importlib-metadata==6.8.0 # via opentelemetry-api iniconfig==2.0.0 # via pytest @@ -68,80 +70,80 @@ markupsafe==2.1.3 # via jinja2 mccabe==0.7.0 # via flake8 -motor==3.1.2 +motor==3.3.1 # via lta (setup.py) -mypy==1.3.0 +mypy==1.5.1 # via lta (setup.py) mypy-extensions==1.0.0 # via mypy -opentelemetry-api==1.18.0 +opentelemetry-api==1.20.0 # via # opentelemetry-exporter-jaeger-proto-grpc # opentelemetry-exporter-jaeger-thrift # opentelemetry-exporter-otlp-proto-http # opentelemetry-sdk # wipac-telemetry -opentelemetry-exporter-jaeger==1.18.0 +opentelemetry-exporter-jaeger==1.20.0 # via wipac-telemetry -opentelemetry-exporter-jaeger-proto-grpc==1.18.0 +opentelemetry-exporter-jaeger-proto-grpc==1.20.0 # via opentelemetry-exporter-jaeger -opentelemetry-exporter-jaeger-thrift==1.18.0 +opentelemetry-exporter-jaeger-thrift==1.20.0 # via opentelemetry-exporter-jaeger -opentelemetry-exporter-otlp-proto-common==1.18.0 +opentelemetry-exporter-otlp-proto-common==1.20.0 # via opentelemetry-exporter-otlp-proto-http -opentelemetry-exporter-otlp-proto-http==1.18.0 +opentelemetry-exporter-otlp-proto-http==1.20.0 # via wipac-telemetry -opentelemetry-proto==1.18.0 +opentelemetry-proto==1.20.0 # via # opentelemetry-exporter-otlp-proto-common # opentelemetry-exporter-otlp-proto-http -opentelemetry-sdk==1.18.0 +opentelemetry-sdk==1.20.0 # via # opentelemetry-exporter-jaeger-proto-grpc # opentelemetry-exporter-jaeger-thrift # opentelemetry-exporter-otlp-proto-http # wipac-telemetry -opentelemetry-semantic-conventions==0.39b0 +opentelemetry-semantic-conventions==0.41b0 # via opentelemetry-sdk packaging==23.1 # via pytest -pluggy==1.0.0 +pluggy==1.3.0 # via pytest -prometheus-client==0.17.0 +prometheus-client==0.17.1 # via lta (setup.py) protobuf==3.20.3 # via # googleapis-common-protos # opentelemetry-proto # wipac-telemetry -pycodestyle==2.10.0 +pycodestyle==2.11.0 # via flake8 pycparser==2.21 # via cffi pycycle==0.0.8 # via lta (setup.py) -pyflakes==3.0.1 +pyflakes==3.1.0 # via flake8 -pyjwt[crypto]==2.7.0 +pyjwt[crypto]==2.8.0 # via wipac-rest-tools -pymongo==4.3.3 +pymongo==4.5.0 # via # lta (setup.py) # motor pypng==0.20220715.0 # via qrcode -pytest==7.3.2 +pytest==7.4.1 # via # lta (setup.py) # pycycle # pytest-asyncio # pytest-cov # pytest-mock -pytest-asyncio==0.21.0 +pytest-asyncio==0.21.1 # via lta (setup.py) pytest-cov==4.1.0 # via lta (setup.py) -pytest-mock==3.10.0 +pytest-mock==3.11.1 # via lta (setup.py) qrcode==7.4.2 # via wipac-rest-tools @@ -152,9 +154,9 @@ requests==2.31.0 # requests-futures # wipac-dev-tools # wipac-rest-tools -requests-futures==1.0.0 +requests-futures==1.0.1 # via wipac-rest-tools -shellingham==1.5.0.post1 +shellingham==1.5.3 # via click-completion six==1.16.0 # via @@ -167,35 +169,37 @@ tomli==2.0.1 # coverage # mypy # pytest -tornado==6.3.2 +tornado==6.3.3 # via # lta (setup.py) # wipac-rest-tools -types-requests==2.31.0.1 +types-requests==2.31.0.2 # via lta (setup.py) -types-urllib3==1.26.25.13 +types-urllib3==1.26.25.14 # via types-requests -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via # mypy # opentelemetry-sdk # qrcode # wipac-dev-tools # wipac-telemetry -urllib3==2.0.3 - # via requests +urllib3==2.0.4 + # via + # requests + # wipac-rest-tools wipac-dev-tools==1.6.16 # via # lta (setup.py) # wipac-rest-tools # wipac-telemetry -wipac-rest-tools==1.4.20 +wipac-rest-tools==1.5.3 # via lta (setup.py) wipac-telemetry==0.2.7 # via lta (setup.py) wrapt==1.15.0 # via deprecated -zipp==3.15.0 +zipp==3.16.2 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements-monitoring.txt b/requirements-monitoring.txt index 2dbf7a0..3be4d20 100644 --- a/requirements-monitoring.txt +++ b/requirements-monitoring.txt @@ -4,27 +4,29 @@ # # pip-compile --extra=monitoring --output-file=requirements-monitoring.txt # -aiohttp==3.8.4 +aiohttp==3.8.5 # via elasticsearch aiosignal==1.3.1 # via aiohttp -async-timeout==4.0.2 +async-timeout==4.0.3 # via aiohttp attrs==23.1.0 # via aiohttp backoff==2.2.1 - # via opentelemetry-exporter-otlp-proto-http + # via + # opentelemetry-exporter-otlp-proto-common + # opentelemetry-exporter-otlp-proto-http binpacking==1.5.2 # via lta (setup.py) cachetools==5.3.1 # via wipac-rest-tools -certifi==2023.5.7 +certifi==2023.7.22 # via # elasticsearch # requests cffi==1.15.1 # via cryptography -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 # via # aiohttp # requests @@ -32,17 +34,17 @@ colorama==0.4.6 # via lta (setup.py) coloredlogs==15.0.1 # via wipac-telemetry -cryptography==41.0.1 +cryptography==41.0.3 # via pyjwt deprecated==1.2.14 # via # opentelemetry-api # opentelemetry-exporter-otlp-proto-http -dnspython==2.3.0 +dnspython==2.4.2 # via pymongo -elasticsearch[async]==7.17.9 +elasticsearch[async]==7.9.1 # via lta (setup.py) -frozenlist==1.3.3 +frozenlist==1.4.0 # via # aiohttp # aiosignal @@ -52,7 +54,7 @@ googleapis-common-protos==1.56.2 # via # opentelemetry-exporter-jaeger-proto-grpc # opentelemetry-exporter-otlp-proto-http -grpcio==1.54.2 +grpcio==1.57.0 # via opentelemetry-exporter-jaeger-proto-grpc humanfriendly==10.0 # via coloredlogs @@ -62,44 +64,44 @@ idna==3.4 # via # requests # yarl -importlib-metadata==6.0.1 +importlib-metadata==6.8.0 # via opentelemetry-api -motor==3.1.2 +motor==3.3.1 # via lta (setup.py) multidict==6.0.4 # via # aiohttp # yarl -opentelemetry-api==1.18.0 +opentelemetry-api==1.20.0 # via # opentelemetry-exporter-jaeger-proto-grpc # opentelemetry-exporter-jaeger-thrift # opentelemetry-exporter-otlp-proto-http # opentelemetry-sdk # wipac-telemetry -opentelemetry-exporter-jaeger==1.18.0 +opentelemetry-exporter-jaeger==1.20.0 # via wipac-telemetry -opentelemetry-exporter-jaeger-proto-grpc==1.18.0 +opentelemetry-exporter-jaeger-proto-grpc==1.20.0 # via opentelemetry-exporter-jaeger -opentelemetry-exporter-jaeger-thrift==1.18.0 +opentelemetry-exporter-jaeger-thrift==1.20.0 # via opentelemetry-exporter-jaeger -opentelemetry-exporter-otlp-proto-common==1.18.0 +opentelemetry-exporter-otlp-proto-common==1.20.0 # via opentelemetry-exporter-otlp-proto-http -opentelemetry-exporter-otlp-proto-http==1.18.0 +opentelemetry-exporter-otlp-proto-http==1.20.0 # via wipac-telemetry -opentelemetry-proto==1.18.0 +opentelemetry-proto==1.20.0 # via # opentelemetry-exporter-otlp-proto-common # opentelemetry-exporter-otlp-proto-http -opentelemetry-sdk==1.18.0 +opentelemetry-sdk==1.20.0 # via # opentelemetry-exporter-jaeger-proto-grpc # opentelemetry-exporter-jaeger-thrift # opentelemetry-exporter-otlp-proto-http # wipac-telemetry -opentelemetry-semantic-conventions==0.39b0 +opentelemetry-semantic-conventions==0.41b0 # via opentelemetry-sdk -prometheus-client==0.17.0 +prometheus-client==0.17.1 # via lta (setup.py) protobuf==3.20.3 # via @@ -108,9 +110,9 @@ protobuf==3.20.3 # wipac-telemetry pycparser==2.21 # via cffi -pyjwt[crypto]==2.7.0 +pyjwt[crypto]==2.8.0 # via wipac-rest-tools -pymongo==4.3.3 +pymongo==4.5.0 # via # lta (setup.py) # motor @@ -124,40 +126,43 @@ requests==2.31.0 # requests-futures # wipac-dev-tools # wipac-rest-tools -requests-futures==1.0.0 +requests-futures==1.0.1 # via wipac-rest-tools six==1.16.0 # via thrift thrift==0.16.0 # via opentelemetry-exporter-jaeger-thrift -tornado==6.3.2 +tornado==6.3.3 # via # lta (setup.py) # wipac-rest-tools -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via # opentelemetry-sdk # qrcode # wipac-dev-tools # wipac-telemetry -urllib3==1.26.16 +urllib3==2.0.4 # via # elasticsearch # requests + # wipac-rest-tools wipac-dev-tools==1.6.16 # via # lta (setup.py) # wipac-rest-tools # wipac-telemetry -wipac-rest-tools==1.4.20 +wipac-rest-tools==1.5.3 # via lta (setup.py) wipac-telemetry==0.2.7 # via lta (setup.py) wrapt==1.15.0 # via deprecated yarl==1.9.2 - # via aiohttp -zipp==3.15.0 + # via + # aiohttp + # elasticsearch +zipp==3.16.2 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements.txt b/requirements.txt index 4881397..7edf42c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,28 +5,30 @@ # pip-compile --output-file=requirements.txt # backoff==2.2.1 - # via opentelemetry-exporter-otlp-proto-http + # via + # opentelemetry-exporter-otlp-proto-common + # opentelemetry-exporter-otlp-proto-http binpacking==1.5.2 # via lta (setup.py) cachetools==5.3.1 # via wipac-rest-tools -certifi==2023.5.7 +certifi==2023.7.22 # via requests cffi==1.15.1 # via cryptography -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 # via requests colorama==0.4.6 # via lta (setup.py) coloredlogs==15.0.1 # via wipac-telemetry -cryptography==41.0.1 +cryptography==41.0.3 # via pyjwt deprecated==1.2.14 # via # opentelemetry-api # opentelemetry-exporter-otlp-proto-http -dnspython==2.3.0 +dnspython==2.4.2 # via pymongo future==0.18.3 # via binpacking @@ -34,7 +36,7 @@ googleapis-common-protos==1.56.2 # via # opentelemetry-exporter-jaeger-proto-grpc # opentelemetry-exporter-otlp-proto-http -grpcio==1.54.2 +grpcio==1.57.0 # via opentelemetry-exporter-jaeger-proto-grpc humanfriendly==10.0 # via coloredlogs @@ -42,40 +44,40 @@ hurry-filesize==0.9 # via lta (setup.py) idna==3.4 # via requests -importlib-metadata==6.0.1 +importlib-metadata==6.8.0 # via opentelemetry-api -motor==3.1.2 +motor==3.3.1 # via lta (setup.py) -opentelemetry-api==1.18.0 +opentelemetry-api==1.20.0 # via # opentelemetry-exporter-jaeger-proto-grpc # opentelemetry-exporter-jaeger-thrift # opentelemetry-exporter-otlp-proto-http # opentelemetry-sdk # wipac-telemetry -opentelemetry-exporter-jaeger==1.18.0 +opentelemetry-exporter-jaeger==1.20.0 # via wipac-telemetry -opentelemetry-exporter-jaeger-proto-grpc==1.18.0 +opentelemetry-exporter-jaeger-proto-grpc==1.20.0 # via opentelemetry-exporter-jaeger -opentelemetry-exporter-jaeger-thrift==1.18.0 +opentelemetry-exporter-jaeger-thrift==1.20.0 # via opentelemetry-exporter-jaeger -opentelemetry-exporter-otlp-proto-common==1.18.0 +opentelemetry-exporter-otlp-proto-common==1.20.0 # via opentelemetry-exporter-otlp-proto-http -opentelemetry-exporter-otlp-proto-http==1.18.0 +opentelemetry-exporter-otlp-proto-http==1.20.0 # via wipac-telemetry -opentelemetry-proto==1.18.0 +opentelemetry-proto==1.20.0 # via # opentelemetry-exporter-otlp-proto-common # opentelemetry-exporter-otlp-proto-http -opentelemetry-sdk==1.18.0 +opentelemetry-sdk==1.20.0 # via # opentelemetry-exporter-jaeger-proto-grpc # opentelemetry-exporter-jaeger-thrift # opentelemetry-exporter-otlp-proto-http # wipac-telemetry -opentelemetry-semantic-conventions==0.39b0 +opentelemetry-semantic-conventions==0.41b0 # via opentelemetry-sdk -prometheus-client==0.17.0 +prometheus-client==0.17.1 # via lta (setup.py) protobuf==3.20.3 # via @@ -84,9 +86,9 @@ protobuf==3.20.3 # wipac-telemetry pycparser==2.21 # via cffi -pyjwt[crypto]==2.7.0 +pyjwt[crypto]==2.8.0 # via wipac-rest-tools -pymongo==4.3.3 +pymongo==4.5.0 # via # lta (setup.py) # motor @@ -100,36 +102,38 @@ requests==2.31.0 # requests-futures # wipac-dev-tools # wipac-rest-tools -requests-futures==1.0.0 +requests-futures==1.0.1 # via wipac-rest-tools six==1.16.0 # via thrift thrift==0.16.0 # via opentelemetry-exporter-jaeger-thrift -tornado==6.3.2 +tornado==6.3.3 # via # lta (setup.py) # wipac-rest-tools -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via # opentelemetry-sdk # qrcode # wipac-dev-tools # wipac-telemetry -urllib3==2.0.3 - # via requests +urllib3==2.0.4 + # via + # requests + # wipac-rest-tools wipac-dev-tools==1.6.16 # via # lta (setup.py) # wipac-rest-tools # wipac-telemetry -wipac-rest-tools==1.4.20 +wipac-rest-tools==1.5.3 # via lta (setup.py) wipac-telemetry==0.2.7 # via lta (setup.py) wrapt==1.15.0 # via deprecated -zipp==3.15.0 +zipp==3.16.2 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: diff --git a/tests/test_deleter.py b/tests/test_deleter.py index 2afc261..cc3f75a 100644 --- a/tests/test_deleter.py +++ b/tests/test_deleter.py @@ -257,5 +257,9 @@ async def test_deleter_quarantine_bundle_with_reason(config: TestConfig, mocker: logger_mock = mocker.MagicMock() lta_rc_mock = mocker.patch("rest_tools.client.RestClient", new_callable=AsyncMock) p = Deleter(config, logger_mock) - await p._quarantine_bundle(lta_rc_mock, {"uuid": "c4b345e4-2395-4f9e-b0eb-9cc1c9cdf003"}, "Rucio caught fire, then we roasted marshmellows.") + await p._quarantine_bundle( + lta_rc_mock, + {"status": "completed", "uuid": "c4b345e4-2395-4f9e-b0eb-9cc1c9cdf003"}, + "Rucio caught fire, then we roasted marshmellows." + ) lta_rc_mock.request.assert_called_with("PATCH", "/Bundles/c4b345e4-2395-4f9e-b0eb-9cc1c9cdf003", mocker.ANY) diff --git a/tests/test_locator.py b/tests/test_locator.py index 20d33fa..4cdd443 100644 --- a/tests/test_locator.py +++ b/tests/test_locator.py @@ -303,7 +303,7 @@ async def test_locator_do_work_transfer_request_fc_exception(config: TestConfig, @pytest.mark.asyncio async def test_locator_do_work_transfer_request_fc_no_results(config: TestConfig, mocker: MockerFixture) -> None: """Test that _do_work_transfer_request raises an exception when the LTA DB refuses to create an empty list.""" - QUARANTINE = {'status': 'quarantined', 'reason': mocker.ANY, 'work_priority_timestamp': mocker.ANY} + QUARANTINE = {'original_status': 'ethereal', 'status': 'quarantined', 'reason': mocker.ANY, 'work_priority_timestamp': mocker.ANY} logger_mock = mocker.MagicMock() p = Locator(config, logger_mock) lta_rc_mock = mocker.MagicMock() @@ -312,6 +312,7 @@ async def test_locator_do_work_transfer_request_fc_no_results(config: TestConfig tr_uuid = uuid1().hex tr = { "uuid": tr_uuid, + "status": "ethereal", "source": "wipac", "dest": "nersc", "path": "/tmp/this/is/just/a/test", diff --git a/tests/test_nersc_mover.py b/tests/test_nersc_mover.py index 2dc209e..c6c38b9 100644 --- a/tests/test_nersc_mover.py +++ b/tests/test_nersc_mover.py @@ -309,6 +309,7 @@ async def test_nersc_mover_do_work_claim_write_bundle_raise_exception(config: Te { "bundle": { "uuid": "8f03a920-49d6-446b-811e-830e3f7942f5", + "status": "taping", }, }, {} @@ -318,7 +319,10 @@ async def test_nersc_mover_do_work_claim_write_bundle_raise_exception(config: Te p = NerscMover(config, logger_mock) assert not await p._do_work_claim() lta_rc_mock.assert_called_with("PATCH", '/Bundles/8f03a920-49d6-446b-811e-830e3f7942f5', mocker.ANY) - wbth_mock.assert_called_with(mocker.ANY, {"uuid": "8f03a920-49d6-446b-811e-830e3f7942f5"}) + wbth_mock.assert_called_with( + mocker.ANY, + {"uuid": "8f03a920-49d6-446b-811e-830e3f7942f5", "status": "taping"} + ) @pytest.mark.asyncio diff --git a/tests/test_nersc_verifier.py b/tests/test_nersc_verifier.py index 239a030..c04f337 100644 --- a/tests/test_nersc_verifier.py +++ b/tests/test_nersc_verifier.py @@ -349,6 +349,7 @@ async def test_nersc_verifier_do_work_claim_exception_caught(config: TestConfig, { "bundle": { "uuid": "45ae2ad39c664fda86e5981be0976d9c", + "status": "verifying", "one": 1, }, }, @@ -359,7 +360,10 @@ async def test_nersc_verifier_do_work_claim_exception_caught(config: TestConfig, p = NerscVerifier(config, logger_mock) assert not await p._do_work_claim() lta_rc_mock.assert_called_with("PATCH", '/Bundles/45ae2ad39c664fda86e5981be0976d9c', mocker.ANY) - vbih_mock.assert_called_with(mocker.ANY, {"uuid": "45ae2ad39c664fda86e5981be0976d9c", "one": 1}) + vbih_mock.assert_called_with( + mocker.ANY, + {"uuid": "45ae2ad39c664fda86e5981be0976d9c", "status": "verifying", "one": 1} + ) @pytest.mark.asyncio diff --git a/tests/test_picker.py b/tests/test_picker.py index 9d520c9..3b14d5f 100644 --- a/tests/test_picker.py +++ b/tests/test_picker.py @@ -283,7 +283,7 @@ async def test_picker_do_work_transfer_request_fc_exception(config: TestConfig, @pytest.mark.asyncio async def test_picker_do_work_transfer_request_fc_no_results(config: TestConfig, mocker: MockerFixture) -> None: """Test that _do_work_transfer_request raises an exception when the LTA DB refuses to create an empty list.""" - QUARANTINE = {'status': 'quarantined', 'reason': mocker.ANY, 'work_priority_timestamp': mocker.ANY} + QUARANTINE = {'original_status': 'ethereal', 'status': 'quarantined', 'reason': mocker.ANY, 'work_priority_timestamp': mocker.ANY} logger_mock = mocker.MagicMock() p = Picker(config, logger_mock) lta_rc_mock = mocker.MagicMock() @@ -292,6 +292,7 @@ async def test_picker_do_work_transfer_request_fc_no_results(config: TestConfig, tr_uuid = uuid1().hex tr = { "uuid": tr_uuid, + "status": "ethereal", "source": "wipac", "dest": "nersc", "path": "/tmp/this/is/just/a/test", diff --git a/tests/test_rate_limiter.py b/tests/test_rate_limiter.py index 2b896dd..ad5c0d3 100644 --- a/tests/test_rate_limiter.py +++ b/tests/test_rate_limiter.py @@ -291,7 +291,11 @@ async def test_rate_limiter_quarantine_bundle_with_reason(config: TestConfig, mo logger_mock = mocker.MagicMock() lta_rc_mock = mocker.patch("rest_tools.client.RestClient", new_callable=AsyncMock) p = RateLimiter(config, logger_mock) - await p._quarantine_bundle(lta_rc_mock, {"uuid": "c4b345e4-2395-4f9e-b0eb-9cc1c9cdf003"}, "Rucio caught fire, then we roasted marshmellows.") + await p._quarantine_bundle( + lta_rc_mock, + {"uuid": "c4b345e4-2395-4f9e-b0eb-9cc1c9cdf003", "status": "created"}, + "Rucio caught fire, then we roasted marshmellows." + ) lta_rc_mock.request.assert_called_with("PATCH", "/Bundles/c4b345e4-2395-4f9e-b0eb-9cc1c9cdf003", mocker.ANY) diff --git a/tests/test_unpacker.py b/tests/test_unpacker.py index c84930a..0b70712 100644 --- a/tests/test_unpacker.py +++ b/tests/test_unpacker.py @@ -325,7 +325,11 @@ async def test_unpacker_quarantine_bundle_with_reason(config: TestConfig, mocker logger_mock = mocker.MagicMock() lta_rc_mock = mocker.patch("rest_tools.client.RestClient", new_callable=AsyncMock) p = Unpacker(config, logger_mock) - await p._quarantine_bundle(lta_rc_mock, {"uuid": "c4b345e4-2395-4f9e-b0eb-9cc1c9cdf003"}, "Rucio caught fire, then we roasted marshmellows.") + await p._quarantine_bundle( + lta_rc_mock, + {"uuid": "c4b345e4-2395-4f9e-b0eb-9cc1c9cdf003", "status": "unpacking"}, + "Rucio caught fire, then we roasted marshmellows." + ) lta_rc_mock.request.assert_called_with("PATCH", "/Bundles/c4b345e4-2395-4f9e-b0eb-9cc1c9cdf003", mocker.ANY) @@ -336,7 +340,11 @@ async def test_unpacker_quarantine_bundle_with_reason_raises(config: TestConfig, lta_rc_mock = mocker.patch("rest_tools.client.RestClient", new_callable=AsyncMock) lta_rc_mock.request.side_effect = Exception("Marshmellows were poisoned") p = Unpacker(config, logger_mock) - await p._quarantine_bundle(lta_rc_mock, {"uuid": "c4b345e4-2395-4f9e-b0eb-9cc1c9cdf003"}, "Rucio caught fire, then we roasted marshmellows.") + await p._quarantine_bundle( + lta_rc_mock, + {"uuid": "c4b345e4-2395-4f9e-b0eb-9cc1c9cdf003", "status": "unpacking"}, + "Rucio caught fire, then we roasted marshmellows." + ) lta_rc_mock.request.assert_called_with("PATCH", "/Bundles/c4b345e4-2395-4f9e-b0eb-9cc1c9cdf003", mocker.ANY)