Skip to content

Commit

Permalink
Handle assignment-approved arguments differently inside _handleNoSatu…
Browse files Browse the repository at this point in the history
…sUpdate calls
  • Loading branch information
todor-ivanov committed Oct 21, 2024
1 parent dee132a commit 62a6d43
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/python/WMCore/ReqMgr/Service/Request.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def _handleNoStatusUpdate(self, workload, request_args, dn):
reqArgs = deepcopy(request_args)

if not reqArgs:
cherrypy.log("Nothing to be changed at this stage")
cherrypy.log(f"Nothing to be changed at this stage for {workload.name()}")
return 'OK'

if workqueue_stat_validation(reqArgs):
Expand All @@ -441,9 +441,15 @@ def _handleNoStatusUpdate(self, workload, request_args, dn):
reqArgsNothandled.append(reqArg)
cherrypy.log("Unhandled argument for no-status update: %s" % reqArg)

reqStatus = self.reqmgr_db_service.getRequestByNames(workload.name())[workload.name()]['RequestStatus']
cherrypy.log(f"CurrentRequest status: {reqStatus}")
if reqArgsNothandled:
msg = "There were unhandled arguments left for no-status update: %s" % reqArgsNothandled
raise InvalidSpecParameterValue(msg)
if reqStatus == 'assignment-approved':
cherrypy.log(f"Handling assignment-approved arguments differently!")
self._handleAssignmentStateTransition(workload, request_args, dn)
else:
msg = "There were unhandled arguments left for no-status update: %s" % reqArgsNothandled
raise InvalidSpecParameterValue(msg)

# Commit the changes of the current workload object to the database:
workload.saveCouchUrl(workload.specUrl())
Expand Down

0 comments on commit 62a6d43

Please sign in to comment.