Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit65abb85

Browse files
emanueleainanejch
authored andcommitted
fix(cli): Enable debug before doing auth
Authentication issues are currently hard to debug since `--debug` onlyhas effect after `gl.auth()` has been called.For example, a 401 error is printed without any details about the actualHTTP request being sent: $ gitlab --debug --server-urlhttps://gitlab.com current-user get 401: 401 UnauthorizedBy moving the call to `gl.enable_debug()` the usual debug logs getprinted before the final error message.Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
1 parentd8a657b commit65abb85

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

‎gitlab/cli.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,13 @@ def main() -> None:
366366

367367
try:
368368
gl=gitlab.Gitlab.merge_config(vars(options),gitlab_id,config_files)
369+
ifdebug:
370+
gl.enable_debug()
369371
ifgl.private_tokenorgl.oauth_token:
370372
gl.auth()
371373
exceptExceptionase:
372374
die(str(e))
373375

374-
ifdebug:
375-
gl.enable_debug()
376-
377376
gitlab.v4.cli.run(
378377
gl,gitlab_resource,resource_action,args_dict,verbose,output,fields
379378
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp