Skip to content

Commit

Permalink
ARB: catch network exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Dec 14, 2023
1 parent 5e0e3f1 commit d2eb561
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions tools/arb-update-resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import psutil
from irods.column import In
from irods.exception import NetworkException
from irods.models import Resource
from irods.password_obfuscation import decode as password_decode
from irods.rule import Rule
Expand Down Expand Up @@ -191,20 +192,23 @@ def main():
args = parse_args()
env = get_irods_environment()

session = setup_session(env)
override_free_dict = parse_cs_values(args.override_free)
override_total_dict = parse_cs_values(args.override_total)
local_ufs_resources = get_local_ufs_resources(session)
process_ufs_resources(session,
local_ufs_resources,
override_free_dict,
override_total_dict,
args.verbose)

if is_on_provider():
if args.verbose:
print("Updating misc resources ...")
call_rule_update_misc(session)
try:
session = setup_session(env)
override_free_dict = parse_cs_values(args.override_free)
override_total_dict = parse_cs_values(args.override_total)
local_ufs_resources = get_local_ufs_resources(session)
process_ufs_resources(session,
local_ufs_resources,
override_free_dict,
override_total_dict,
args.verbose)

if is_on_provider():
if args.verbose:
print("Updating misc resources ...")
call_rule_update_misc(session)
except NetworkException:
print("Could not connect to iRODS sever ...")


if __name__ == '__main__':
Expand Down

0 comments on commit d2eb561

Please sign in to comment.