This is an automated email from the ASF dual-hosted git repository.
amoghdesai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new c6b06a77367 Having the entire stacktrace can be confusing (#48829)
c6b06a77367 is described below
commit c6b06a773675b066f7fa86be7ca8c27df3200f4e
Author: Aritra Basu <[email protected]>
AuthorDate: Sun Apr 6 09:21:14 2025 +0530
Having the entire stacktrace can be confusing (#48829)
---
airflow-ctl/src/airflowctl/api/client.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/airflow-ctl/src/airflowctl/api/client.py
b/airflow-ctl/src/airflowctl/api/client.py
index 10dee8096bb..af6f478f35a 100644
--- a/airflow-ctl/src/airflowctl/api/client.py
+++ b/airflow-ctl/src/airflowctl/api/client.py
@@ -27,6 +27,7 @@ from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast
import httpx
import keyring
import structlog
+from keyring.errors import NoKeyringError
from platformdirs import user_config_path
from uuid6 import uuid7
@@ -115,7 +116,10 @@ class Credentials:
os.makedirs(default_config_dir)
with open(os.path.join(default_config_dir,
self.input_cli_config_file), "w") as f:
json.dump({"api_url": self.api_url}, f)
- keyring.set_password("airflow-cli",
f"api_token-{self.api_environment}", self.api_token)
+ try:
+ keyring.set_password("airflow-cli",
f"api_token-{self.api_environment}", self.api_token)
+ except NoKeyringError as e:
+ log.error(e)
def load(self) -> Credentials:
"""Load the credentials from keyring and URL from disk file."""