Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve mount_be with path and add return bectl path #5

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions bectl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
ericbsd marked this conversation as resolved.
Show resolved Hide resolved
"""
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
ericbsd marked this conversation as resolved.
Show resolved Hide resolved
bectl_process = run(
cmd_list,
universal_newlines=True,
ericbsd marked this conversation as resolved.
Show resolved Hide resolved
encoding='utf-8'
)
assert bectl_process.returncode == 0
return bectl_process.stdout.strip()
ericbsd marked this conversation as resolved.
Show resolved Hide resolved


def umount_be(be_name: str):
Expand Down