Skip to content

Commit

Permalink
Check existence of docker image after we have retrieve the default fr…
Browse files Browse the repository at this point in the history
…om the code gen
  • Loading branch information
BenGalewsky committed Dec 8, 2022
1 parent e8eece5 commit 237f985
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions servicex_app/servicex/resources/transformation/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ def post(self):
# TODO: need to check to make sure bucket was created
# WHat happens if object-store and object_store is None?

if config['TRANSFORMER_VALIDATE_DOCKER_IMAGE']:
if not self.docker_repo_adapter.check_image_exists(image):
msg = f"Requested transformer docker image doesn't exist: {image}"
current_app.logger.error(msg, extra={'requestId': request_id})
return {'message': msg}, 400

user = self.get_requesting_user()
request_rec = TransformRequest(
request_id=str(request_id),
Expand Down Expand Up @@ -155,6 +149,12 @@ def post(self):
if not request_rec.image:
request_rec.image = codegen_transformer_image

if config['TRANSFORMER_VALIDATE_DOCKER_IMAGE']:
if not self.docker_repo_adapter.check_image_exists(request_rec.image):
msg = f"Requested transformer docker image doesn't exist: {request_rec.image}"
current_app.logger.error(msg, extra={'requestId': request_id})
return {'message': msg}, 400

# Insure the required queues and exchange exist in RabbitMQ broker
try:
self.rabbitmq_adaptor.setup_exchange('transformation_requests')
Expand Down

0 comments on commit 237f985

Please # to comment.