Skip to content

Commit

Permalink
Merge pull request #4894 from joeldierkes/patch-4870-Traceback_when_r…
Browse files Browse the repository at this point in the history
…equesting_the_global_account_usage_with_a_specific_RSE

Client: Fix faulty list account usage test and untracked error #4870
  • Loading branch information
bari12 committed Oct 12, 2021
2 parents ca19f1b + f8a943c commit 6a60927
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/rucio
Original file line number Diff line number Diff line change
Expand Up @@ -1701,7 +1701,7 @@ def list_account_usage(args):
table = []
usage = client.get_global_account_usage(account=args.usage_account)
for item in usage:
if (args.rse and args.rse in item['resolved_rses']) or not args.rse:
if (args.rse and args.rse in item['rse_expression']) or not args.rse:
remaining = 0 if float(item['bytes_remaining']) < 0 else float(item['bytes_remaining'])
table.append([item['rse_expression'], sizefmt(item['bytes'], args.human), sizefmt(item['bytes_limit'], args.human), sizefmt(remaining, args.human)])
table.sort()
Expand Down
6 changes: 4 additions & 2 deletions lib/rucio/tests/test_bin_rucio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,11 +1565,13 @@ def test_list_account_usage(self):
cmd = 'rucio list-account-usage {0}'.format(account)
exitcode, out, err = execute(cmd)
assert re.search('.*{0}.*{1}.*{2}.*{3}'.format(rse, usage, local_limit, local_left), out) is not None
assert re.search('.*{0}.*{1}.*{2}.*{3}'.format(rse_exp, usage, global_limit, global_left), out) is not None
assert re.search('.*{0}.*{1}.*{2}.*{3}'.format(r'MOCK\|MOCK4', usage, global_limit, global_left), out) is not None

cmd = 'rucio list-account-usage --rse {0} {1}'.format(rse, account)
exitcode, out, err = execute(cmd)
assert exitcode == 0
assert re.search('.*{0}.*{1}.*{2}.*{3}'.format(rse, usage, local_limit, local_left), out) is not None
assert re.search('.*{0}.*{1}.*{2}.*{3}'.format(rse_exp, usage, global_limit, global_left), out) is not None
assert re.search('.*{0}.*{1}.*{2}.*{3}'.format(r'MOCK\|MOCK4', usage, global_limit, global_left), out) is not None
self.account_client.set_local_account_limit(account, rse, -1)
self.account_client.set_global_account_limit(account, rse_exp, -1)

Expand Down

0 comments on commit 6a60927

Please sign in to comment.