From 76f8d32b485708349eea9fe24aadd1a17d0a5a9f Mon Sep 17 00:00:00 2001 From: Kory Draughn Date: Fri, 18 Oct 2024 09:03:51 -0400 Subject: [PATCH] squash. Tweaks to python scripts. --- scripts/irods/controller.py | 13 ++++++++++++- scripts/irods/paths.py | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/irods/controller.py b/scripts/irods/controller.py index 6bc3b37db4..209f600abc 100644 --- a/scripts/irods/controller.py +++ b/scripts/irods/controller.py @@ -254,7 +254,6 @@ def get_binary_to_procs_dict(self, server_proc, server_descendants=None, binarie d[b] = procs return d - # TODO Need one of these for shutdown. def wait_for_server_startup_to_complete(self, max_retries=100): try_count = 1 @@ -278,6 +277,18 @@ def wait_for_server_startup_to_complete(self, max_retries=100): try_count += 1 time.sleep(1) + def wait_for_server_shutdown_to_complete(self, max_retries=100): + for _ in range(max_retries): + l.debug('Waiting for iRODS server to shut down. Attempt #%s', try_count) + try: + os.kill(self.get_server_pid(), 0) + continue + except: + pass + time.sleep(1) + + raise IrodsError('iRODS server failed to start.') + def binary_matches(binary_path, proc): if proc.is_running(): try: diff --git a/scripts/irods/paths.py b/scripts/irods/paths.py index cdd0497a9a..ce19778dcc 100644 --- a/scripts/irods/paths.py +++ b/scripts/irods/paths.py @@ -350,6 +350,7 @@ def _icommands_test_directory(): _icommands_test_directory_cache = _irods_directory() / 'clients' / 'icommands' / 'test' return _icommands_test_directory_cache +# TODO Nothing appears to use this or the functions which this is built upon. def icommands_test_directory(): return str(_icommands_test_directory()) @@ -360,6 +361,7 @@ def _server_test_directory(): _server_test_directory_cache = _irods_directory() / 'test' / 'bin' return _server_test_directory_cache +# TODO Nothing appears to use this or the functions which this is built upon. def server_test_directory(): return str(_server_test_directory())