Skip to content

Commit ebcd5f1

Browse files
committed
Fix after review
1 parent 694f991 commit ebcd5f1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/aleph_client/commands/utils.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from typing import Any, Callable, Dict, List, Optional, TypeVar, Union
99

1010
from aiohttp import ClientSession
11-
from aleph.sdk import AlephHttpClient
1211
from aleph.sdk.chains.ethereum import ETHAccount
1312
from aleph.sdk.conf import settings
1413
from aleph.sdk.exceptions import ForgottenMessageError, MessageNotFoundError
@@ -21,6 +20,7 @@
2120
from rich.prompt import IntPrompt, Prompt, PromptError
2221
from typer import colors, echo, style
2322

23+
from aleph.sdk import AlephHttpClient
2424
from aleph_client.utils import fetch_json
2525

2626
logger = logging.getLogger(__name__)
@@ -121,20 +121,20 @@ def volume_to_dict(volume: List[str]) -> Optional[Dict[str, Union[str, int]]]:
121121
def get_or_prompt_volumes(ephemeral_volume, immutable_volume, persistent_volume):
122122
volumes = []
123123
# Check if the volumes are empty
124-
if persistent_volume is None and ephemeral_volume is None and immutable_volume is None:
124+
if not any([persistent_volume, ephemeral_volume, immutable_volume]):
125125
for volume in prompt_for_volumes():
126126
volumes.append(volume)
127127
echo("\n")
128128

129129
# else parse all the volumes that have passed as the cli parameters and put it into volume list
130130
else:
131-
if len(persistent_volume or []) > 0:
131+
if persistent_volume:
132132
persistent_volume_dict = volume_to_dict(volume=persistent_volume)
133133
volumes.append(persistent_volume_dict)
134-
if len(ephemeral_volume or []) > 0:
134+
if ephemeral_volume:
135135
ephemeral_volume_dict = volume_to_dict(volume=ephemeral_volume)
136136
volumes.append(ephemeral_volume_dict)
137-
if len(immutable_volume or []) > 0:
137+
if immutable_volume:
138138
immutable_volume_dict = volume_to_dict(volume=immutable_volume)
139139
volumes.append(immutable_volume_dict)
140140
return volumes

0 commit comments

Comments
 (0)