Skip to content

Commit

Permalink
Merge pull request #766 from dynamic-entropy/master
Browse files Browse the repository at this point in the history
match rule regex with prefix
  • Loading branch information
dynamic-entropy authored Apr 4, 2024
2 parents 69ce03a + 5028290 commit e7287c9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docker/rucio_client/scripts/CMSRSE.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,9 @@ def _get_protocol(self, proto_json, protos_json):
for rule in tfc:
prefix_regex = re.compile(rule['path'])
if self.cms_type == "test":
prefix_match = prefix_regex.match("/store/test/rucio")
prefix_match = prefix_regex.match("/store/test/rucio/")
else:
prefix_match = prefix_regex.match("/store/temp")
prefix_match = prefix_regex.match("/store/temp/")
if prefix_match:
match_rule = rule['path']
g1 = prefix_match.group(1)
Expand All @@ -458,6 +458,10 @@ def _get_protocol(self, proto_json, protos_json):
# if we're here chances are that the prefix didn't have a prefixed "scheme://"
logging.debug("couldn't find a scheme when calculating special prefix")

# Make sure that prefix always ends with "/"
if prefix[len(prefix) - 1] != "/":
prefix = prefix + "/"

proto['prefix'] = prefix
# Get rid of the TFC since were are using a prefix but don't get rid
# of the web_service_path if it is there
Expand Down Expand Up @@ -583,4 +587,4 @@ def show_proto(self, scheme):
schemes = [scheme]
for proto in self.protocols:
if proto['scheme'] in schemes:
print(json.dumps(proto, sort_keys=False, indent=4))
print(json.dumps(proto, sort_keys=False, indent=4))

0 comments on commit e7287c9

Please sign in to comment.