1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-10-31 11:32:16 +01:00

Add troubleshooting info to gitea_api.Login.DoesNotExist message

This commit is contained in:
2025-04-07 11:40:54 +02:00
parent 70a55e2606
commit fffdda9840

View File

@@ -35,9 +35,13 @@ class Login(BaseModel):
def __str__(self):
if self.kwargs == {"name": None}:
return "Could not find a default Gitea config entry"
return \
"Could not find a default Gitea config entry\n" \
" * either set the default entry by running `git-obs login edit <login> --set-as-default`\n" \
" * or run the command with `-G/--gitea-login <login>` option"
kwargs_str = ", ".join([f"{key}={value}" for key, value in self.kwargs.items()])
return f"Could not find a matching Gitea config entry: {kwargs_str}"
return f"Could not find a matching Gitea config entry: {kwargs_str}\n" \
" * see `git-obs login list` for valid entries"
def __init__(self, **kwargs):
# ignore extra fields