Skip to content

Commit e378cab

Browse files
committed
Fix: we should give crn_version instead of fetching it here
1 parent 5e2665a commit e378cab

File tree

1 file changed

+5
-7
lines changed
  • src/aleph/sdk/client/services

1 file changed

+5
-7
lines changed

src/aleph/sdk/client/services/crn.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,33 +95,31 @@ def find_gpu_on_network(self):
9595
available_gpu_list=available_compatible_gpu,
9696
)
9797

98-
async def filter_crn(
98+
def filter_crn(
9999
self,
100-
latest_crn_version: bool = False,
100+
crn_version: str = None,
101101
ipv6: bool = False,
102102
stream_address: bool = False,
103103
confidential: bool = False,
104104
gpu: bool = False,
105105
) -> list[CRN]:
106106
"""Filter compute resource node list, unfiltered by default.
107107
Args:
108-
latest_crn_version (bool): Filter by latest crn version.
108+
crn_version (str): Filter by specific crn version.
109109
ipv6 (bool): Filter invalid IPv6 configuration.
110110
stream_address (bool): Filter invalid payment receiver address.
111111
confidential (bool): Filter by confidential computing support.
112112
gpu (bool): Filter by GPU support.
113113
Returns:
114114
list[CRN]: List of compute resource nodes. (if no filter applied, return all)
115115
"""
116-
if latest_crn_version:
117-
settings_aggregates = await self._client.settings.get_settings_aggregate()
118116

119117
filtered_crn: list[CRN] = []
120118
for crn_ in self.crns:
121119
# Check crn version
122120
if (
123-
latest_crn_version
124-
and (crn_.version or "0.0.0") < settings_aggregates.last_crn_version
121+
crn_version
122+
and (crn_.version or "0.0.0") < crn_version
125123
):
126124
continue
127125

0 commit comments

Comments
 (0)