|
8 | 8 | from typing import Any, Callable, Dict, List, Optional, TypeVar, Union
|
9 | 9 |
|
10 | 10 | from aiohttp import ClientSession
|
11 |
| -from aleph.sdk import AlephHttpClient |
12 | 11 | from aleph.sdk.chains.ethereum import ETHAccount
|
13 | 12 | from aleph.sdk.conf import settings
|
14 | 13 | from aleph.sdk.exceptions import ForgottenMessageError, MessageNotFoundError
|
|
21 | 20 | from rich.prompt import IntPrompt, Prompt, PromptError
|
22 | 21 | from typer import colors, echo, style
|
23 | 22 |
|
| 23 | +from aleph.sdk import AlephHttpClient |
24 | 24 | from aleph_client.utils import fetch_json
|
25 | 25 |
|
26 | 26 | logger = logging.getLogger(__name__)
|
@@ -121,20 +121,20 @@ def volume_to_dict(volume: List[str]) -> Optional[Dict[str, Union[str, int]]]:
|
121 | 121 | def get_or_prompt_volumes(ephemeral_volume, immutable_volume, persistent_volume):
|
122 | 122 | volumes = []
|
123 | 123 | # 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]): |
125 | 125 | for volume in prompt_for_volumes():
|
126 | 126 | volumes.append(volume)
|
127 | 127 | echo("\n")
|
128 | 128 |
|
129 | 129 | # else parse all the volumes that have passed as the cli parameters and put it into volume list
|
130 | 130 | else:
|
131 |
| - if len(persistent_volume or []) > 0: |
| 131 | + if persistent_volume: |
132 | 132 | persistent_volume_dict = volume_to_dict(volume=persistent_volume)
|
133 | 133 | volumes.append(persistent_volume_dict)
|
134 |
| - if len(ephemeral_volume or []) > 0: |
| 134 | + if ephemeral_volume: |
135 | 135 | ephemeral_volume_dict = volume_to_dict(volume=ephemeral_volume)
|
136 | 136 | volumes.append(ephemeral_volume_dict)
|
137 |
| - if len(immutable_volume or []) > 0: |
| 137 | + if immutable_volume: |
138 | 138 | immutable_volume_dict = volume_to_dict(volume=immutable_volume)
|
139 | 139 | volumes.append(immutable_volume_dict)
|
140 | 140 | return volumes
|
|
0 commit comments