Skip to content

Commit

Permalink
dcache-frontend: check for defined arguments with namespace qos
Browse files Browse the repository at this point in the history
Motivation:

Bug reported by `RT 10532 QoS and Bulk Set-Up in 9.2`

Modfication:

Check that the argument/attribute is defined before
calling get.

Result:

No exception thrown and request is forwarded as it should be.

Target: master
Request: 9.2
Requires-notes: yes
Patch: https://rb.dcache.org/r/14172/
Refers-to: RT 10532
Acked-by: Tigran
  • Loading branch information
alrossi committed Nov 24, 2023
1 parent 9ad93f6 commit 1b10c15
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -443,9 +443,12 @@ public Response cmrResources(
pnfsHandler.renameEntry(path.toString(), target.toString(), true);
break;
case "qos":
String targetQos = reqPayload.getString("target");
String qosPolicy = reqPayload.getString("policy");
Integer qosState = (Integer)reqPayload.get("state");
String targetQos =
reqPayload.has("target") ? reqPayload.getString("target") : null;
String qosPolicy =
reqPayload.has("policy") ? reqPayload.getString("policy") : null;
Integer qosState =
reqPayload.has("state") ? (Integer) reqPayload.get("state") : null;
Subject subject = RequestUser.getSubject();
if (!useQosService) {
new QoSTransitionEngine(poolmanager,
Expand Down

0 comments on commit 1b10c15

Please sign in to comment.