Skip to content

Commit

Permalink
Fix/volume prompt (#267)
Browse files Browse the repository at this point in the history
* fix: skip volume prompts if one is passed in parameters
  • Loading branch information
lgaroche authored Sep 9, 2024
1 parent 44b4ac9 commit 2dba0a0
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 2dba0a0

Please sign in to comment.