Skip to content
Snippets Groups Projects
Commit e4593d55 authored by Martin Barisits's avatar Martin Barisits
Browse files

Merge branch 'patch-2687-Change_availability_check_to_bitwise_or' into 'master'

[RUCIO-2687] Bitwise OR check for availability

See merge request !1758
parents a72b2700 f28ebb3a
Branches master
No related tags found
No related merge requests found
......@@ -90,7 +90,7 @@ def parse_expression(expression, filter=None, session=None):
if filter:
for rse in result:
if filter.get('availability_write', False):
if rse.get('availability') in (7, 3, 2):
if rse.get('availability') & 2:
final_result.append(rse)
if not final_result:
raise RSEBlacklisted('RSE excluded due to write blacklisting.')
......
......@@ -43,7 +43,7 @@ class RSESelector():
if weight is not None:
for rse in rses:
attributes = list_rse_attributes(rse=None, rse_id=rse['id'], session=session)
availability_write = True if rse.get('availability', 7) in (7, 3, 2) else False
availability_write = True if rse.get('availability', 7) & 2 else False
if weight not in attributes:
continue # The RSE does not have the required weight set, therefore it is ignored
try:
......@@ -57,7 +57,7 @@ class RSESelector():
else:
for rse in rses:
mock_rse = has_rse_attribute(rse['id'], 'mock', session=session)
availability_write = True if rse.get('availability', 7) in (7, 3, 2) else False
availability_write = True if rse.get('availability', 7) & 2 else False
self.rses.append({'rse_id': rse['id'],
'weight': 1,
'mock_rse': mock_rse,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment