From 4ed77c20f75f9d9f899e78ff216ffba77ec1c9b2 Mon Sep 17 00:00:00 2001 From: ericbsd Date: Tue, 15 Sep 2026 17:49:17 -0300 Subject: [PATCH 1/2] Fix create_be passing -e and the BE name as a single argument create_be built the command with f'-e {non_active_be}', so bectl received "-e name" as one argv element and the create failed whenever a source BE was given. Build the command left to right instead, in the same order as bectl's usage (create [-r] [-e nonActiveBe] newBeName), which also removes the index juggling and the unused option variable. Also fix grammar in the docstrings and remove the leading whitespace on the .vscode/ and .idea/ entries in .gitignore so they actually match. Resolves ghostbsd/issues#218 Claude-Session: https://claude.ai/code/session_01WRs35f97CmmkH3uEvB6FrX --- .gitignore | 4 ++-- bectl.py | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 10a260e..4a84906 100644 --- a/.gitignore +++ b/.gitignore @@ -129,5 +129,5 @@ dmypy.json .pyre/ .# Editor directories and files - .vscode/ - .idea/ +.vscode/ +.idea/ diff --git a/bectl.py b/bectl.py index 33ef93b..1383b07 100644 --- a/bectl.py +++ b/bectl.py @@ -5,7 +5,7 @@ def activate_be(be_name: str, t: bool = False): """ - This function activate a BE. + This function activates a BE. :param be_name: Name of the BE to activate. :param t: If True, the BE will be activated even if it is mounted. """ @@ -19,24 +19,24 @@ def activate_be(be_name: str, t: bool = False): def create_be(new_be_name: str, non_active_be: str = None, recursive: bool = False): """ - This function create a BE. + This function creates a BE. :param new_be_name: Name of the new BE. - :param non_active_be: Name of the non active BE. + :param non_active_be: Name of the non-active BE. :param recursive: If True, the BE will be created recursively. """ - option = '-r' if recursive else '' - cmd_list = ['bectl', 'create', new_be_name] + cmd_list = ['bectl', 'create'] + if recursive: + cmd_list.append('-r') if non_active_be is not None: - cmd_list.insert(2, f'-e {non_active_be}') - if option == '-r': - cmd_list.insert(2, option) + cmd_list.extend(['-e', non_active_be]) + cmd_list.append(new_be_name) bectl_process = run(cmd_list) assert bectl_process.returncode == 0 def destroy_be(be_name: str, F: bool = False, o: bool = False): """ - This function destroy a BE. + This function destroys a BE. :param be_name: Name of the BE to destroy. :param F: If True, the BE will be destroyed even if it is active. :param o: If True, the BE will be destroyed even if it is mounted. @@ -53,7 +53,7 @@ def destroy_be(be_name: str, F: bool = False, o: bool = False): def rename_be(original_be_name: str, new_be_name: str): """ - This function rename a BE. + This function renames a BE. :param original_be_name: Name of the BE to rename. :param new_be_name: New name of the BE. """ @@ -94,7 +94,7 @@ def umount_be(be_name: str): def get_be_list() -> list: """ - This function get the list of BEs. + This function gets the list of BEs. :return: A list of BEs. """ cmd_list = ['bectl', 'list'] From 1502965af58abefb3169e88acb8f2a13580d206b Mon Sep 17 00:00:00 2001 From: ericbsd Date: Wed, 16 Sep 2026 07:56:39 -0300 Subject: [PATCH 2/2] Bump version to 0.7 in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4abeacc..3f15f37 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup -__VERSION__ = '0.6' +__VERSION__ = '0.7' PROGRAM_VERSION = __VERSION__ setup(