Skip to content

Commit

Permalink
Merge pull request #12108 from todor-ivanov/bugfix_ReqMgr2_FailingToL…
Browse files Browse the repository at this point in the history
…oadRequestUponUpdate_fix-12107

Exclude RequestStatus from the returned values of get_modifiable_properties
  • Loading branch information
amaltaro authored Sep 25, 2024
2 parents 2783009 + 93ab6f7 commit d80165b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/python/WMCore/ReqMgr/DataStructs/RequestStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def get_modifiable_properties(status=None):
"""
if status:
allowedKeys = ALLOWED_ACTIONS_FOR_STATUS.get(status, 'all_attributes')
if not allowedKeys == 'all_attributes':
allowedKeys.extend(ALLOWED_ACTIONS_ALL_STATUS)
# if not allowedKeys == 'all_attributes':
# allowedKeys.extend(ALLOWED_ACTIONS_ALL_STATUS)
return allowedKeys
else:
return ALLOWED_ACTIONS_FOR_STATUS
Expand Down
3 changes: 2 additions & 1 deletion src/python/WMCore/ReqMgr/Utils/Validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from WMCore.REST.Auth import authz_match
from WMCore.ReqMgr.DataStructs.Request import initialize_request_args, initialize_clone
from WMCore.ReqMgr.DataStructs.RequestError import InvalidStateTransition, InvalidSpecParameterValue
from WMCore.ReqMgr.DataStructs.RequestStatus import check_allowed_transition, get_modifiable_properties, STATES_ALLOW_ONLY_STATE_TRANSITION, ALLOWED_STAT_KEYS
from WMCore.ReqMgr.DataStructs.RequestStatus import check_allowed_transition, get_modifiable_properties, STATES_ALLOW_ONLY_STATE_TRANSITION, ALLOWED_STAT_KEYS, ALLOWED_ACTIONS_ALL_STATUS
from WMCore.ReqMgr.Tools.cms import releases, architectures, dashboardActivities
from WMCore.Services.DBS.DBS3Reader import getDataTiers
from WMCore.WMFactory import WMFactory
Expand Down Expand Up @@ -56,6 +56,7 @@ def _validate_request_allowed_args(reqArgs, newReqArgs):

allowedKeys = deepcopy(get_modifiable_properties(status))
allowedKeys.extend(ALLOWED_STAT_KEYS)
allowedKeys.extend(ALLOWED_ACTIONS_ALL_STATUS)

# Filter out all fields which are not allowed for the given source status:
for key in reqArgsDiffKeys:
Expand Down

0 comments on commit d80165b

Please sign in to comment.