@ -3851,6 +3851,10 @@ def CMDcreds_check(parser, args):
""" Checks credentials and suggests changes. """
""" Checks credentials and suggests changes. """
_ , _ = parser . parse_args ( args )
_ , _ = parser . parse_args ( args )
if newauth . Enabled ( ) :
ConfigureGitRepoAuth ( )
return 0
# Code below checks .gitcookies. Abort if using something else.
# Code below checks .gitcookies. Abort if using something else.
authn = gerrit_util . Authenticator . get ( )
authn = gerrit_util . Authenticator . get ( )
if not isinstance ( authn , gerrit_util . CookiesAuthenticator ) :
if not isinstance ( authn , gerrit_util . CookiesAuthenticator ) :
@ -3866,19 +3870,16 @@ def CMDcreds_check(parser, args):
' export SKIP_GCE_AUTH_FOR_GIT=1 in your env. ' )
' export SKIP_GCE_AUTH_FOR_GIT=1 in your env. ' )
DieWithError ( message )
DieWithError ( message )
if newauth . Enabled ( ) :
checker = _GitCookiesChecker ( )
ConfigureGitRepoAuth ( )
checker . ensure_configured_gitcookies ( )
else :
checker = _GitCookiesChecker ( )
checker . ensure_configured_gitcookies ( )
print ( ' Your .gitcookies have credentials for these hosts: ' )
print ( ' Your .gitcookies have credentials for these hosts: ' )
checker . print_current_creds ( )
checker . print_current_creds ( )
if not checker . find_and_report_problems ( ) :
if not checker . find_and_report_problems ( ) :
print ( ' \n No problems detected in your .gitcookies file. ' )
print ( ' \n No problems detected in your .gitcookies file. ' )
return 0
return 0
return 1
return 1
@metrics.collector.collect_metrics ( ' git cl baseurl ' )
@metrics.collector.collect_metrics ( ' git cl baseurl ' )