From 461cdf7cac5bc3ba83c9af3164e4d33fa6b05937 Mon Sep 17 00:00:00 2001 From: jonct <2807816+jonct@users.noreply.github.com> Date: Mon, 15 Jul 2024 00:51:17 -0400 Subject: [PATCH] Extract parent dataset utils --- src/jlmkr/donor/jlmkr.py | 9 --------- src/jlmkr/utils/parent_dataset.py | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 src/jlmkr/utils/parent_dataset.py diff --git a/src/jlmkr/donor/jlmkr.py b/src/jlmkr/donor/jlmkr.py index 8995555..62543ec 100755 --- a/src/jlmkr/donor/jlmkr.py +++ b/src/jlmkr/donor/jlmkr.py @@ -1287,15 +1287,6 @@ def run_command_and_parse_json(command): return None -def get_all_jail_names(): - try: - jail_names = os.listdir(JAILS_DIR_PATH) - except FileNotFoundError: - jail_names = [] - - return jail_names - - def list_jails(): """ List all available and running jails. diff --git a/src/jlmkr/utils/parent_dataset.py b/src/jlmkr/utils/parent_dataset.py new file mode 100644 index 0000000..2dce34a --- /dev/null +++ b/src/jlmkr/utils/parent_dataset.py @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: © 2024 Jip-Hop and the Jailmakers +# +# SPDX-License-Identifier: LGPL-3.0-only + +import os + +from donor.jlmkr import JAILS_DIR_PATH + + +def get_all_jail_names(): + try: + jail_names = os.listdir(JAILS_DIR_PATH) + except FileNotFoundError: + jail_names = [] + + return jail_names