diff --git a/bectl.py b/bectl.py index b42dd7b..2ceb7fa 100644 --- a/bectl.py +++ b/bectl.py @@ -62,14 +62,23 @@ def rename_be(original_be_name: str, new_be_name: str): assert bectl_process.returncode == 0 -def mount_be(be_name: str): +def mount_be(be_name: str, path: str = None) -> str: """ - This function mount the BE. + This function mounts the BE. :param be_name: Name of the BE to mount. + :param path: The path where the BE will be mounted. If not provided, + a bectl will create a random one. + :return: The path where the BE is mounted. """ cmd_list = ['bectl', 'mount', be_name] - bectl_process = run(cmd_list) + cmd_list.append(path) if path else None + bectl_process = run( + cmd_list, + universal_newlines=True, + encoding='utf-8' + ) assert bectl_process.returncode == 0 + return bectl_process.stdout.strip() def umount_be(be_name: str):