Skip to content

Commit 876f281

Browse files
committed
fix(cli_update): fix ak-sk of cli update (cloudapp)
1 parent 081aae3 commit 876f281

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

veadk/cloud/cloud_agent_engine.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ class CloudAgentEngine(BaseModel):
5757
```
5858
"""
5959

60-
volcengine_access_key: str = getenv("VOLCENGINE_ACCESS_KEY")
61-
volcengine_secret_key: str = getenv("VOLCENGINE_SECRET_KEY")
60+
volcengine_access_key: str = getenv(
61+
"VOLCENGINE_ACCESS_KEY", "", allow_false_values=True
62+
)
63+
volcengine_secret_key: str = getenv(
64+
"VOLCENGINE_SECRET_KEY", "", allow_false_values=True
65+
)
6266
region: str = "cn-beijing"
6367

6468
def model_post_init(self, context: Any, /) -> None:

veadk/cloud/cloud_app.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,12 @@ def __init__(
124124

125125
def _get_vefaas_endpoint(
126126
self,
127-
volcengine_ak: str = getenv("VOLCENGINE_ACCESS_KEY"),
128-
volcengine_sk: str = getenv("VOLCENGINE_SECRET_KEY"),
127+
volcengine_ak: str = getenv(
128+
"VOLCENGINE_ACCESS_KEY", "", allow_false_values=True
129+
),
130+
volcengine_sk: str = getenv(
131+
"VOLCENGINE_SECRET_KEY", "", allow_false_values=True
132+
),
129133
) -> str:
130134
"""Fetches the application endpoint from VeFaaS details if not directly provided.
131135
@@ -244,8 +248,12 @@ async def _get_a2a_client(self) -> A2AClient:
244248
def update_self(
245249
self,
246250
path: str,
247-
volcengine_ak: str = getenv("VOLCENGINE_ACCESS_KEY"),
248-
volcengine_sk: str = getenv("VOLCENGINE_SECRET_KEY"),
251+
volcengine_ak: str = getenv(
252+
"VOLCENGINE_ACCESS_KEY", "", allow_false_values=True
253+
),
254+
volcengine_sk: str = getenv(
255+
"VOLCENGINE_SECRET_KEY", "", allow_false_values=True
256+
),
249257
):
250258
"""Updates the configuration of this cloud application.
251259
@@ -291,8 +299,12 @@ def update_self(
291299

292300
def delete_self(
293301
self,
294-
volcengine_ak: str = getenv("VOLCENGINE_ACCESS_KEY"),
295-
volcengine_sk: str = getenv("VOLCENGINE_SECRET_KEY"),
302+
volcengine_ak: str = getenv(
303+
"VOLCENGINE_ACCESS_KEY", "", allow_false_values=True
304+
),
305+
volcengine_sk: str = getenv(
306+
"VOLCENGINE_SECRET_KEY", "", allow_false_values=True
307+
),
296308
):
297309
"""Deletes this cloud application after interactive confirmation.
298310

0 commit comments

Comments
 (0)