Skip to content

Fix/volume prompt #267

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

Merged
merged 3 commits into from
Sep 9, 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
8 changes: 4 additions & 4 deletions src/aleph_client/commands/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,20 @@ def volume_to_dict(volume: List[str]) -> Optional[Dict[str, Union[str, int]]]:
def get_or_prompt_volumes(ephemeral_volume, immutable_volume, persistent_volume):
volumes = []
# Check if the volumes are empty
if persistent_volume is None or ephemeral_volume is None or immutable_volume is None:
if not any([persistent_volume, ephemeral_volume, immutable_volume]):
for volume in prompt_for_volumes():
volumes.append(volume)
echo("\n")

# else parse all the volumes that have passed as the cli parameters and put it into volume list
else:
if len(persistent_volume) > 0:
if persistent_volume:
persistent_volume_dict = volume_to_dict(volume=persistent_volume)
volumes.append(persistent_volume_dict)
if len(ephemeral_volume) > 0:
if ephemeral_volume:
ephemeral_volume_dict = volume_to_dict(volume=ephemeral_volume)
volumes.append(ephemeral_volume_dict)
if len(immutable_volume) > 0:
if immutable_volume:
immutable_volume_dict = volume_to_dict(volume=immutable_volume)
volumes.append(immutable_volume_dict)
return volumes
Expand Down
Loading