Example #1
0
def get_gitlab():
    """Return a logged-in instance of the gitlab client.

    Authenticate the client. If the authentication fails with an Unauthorized error,
    ask the user to provide the token again and retry.
    """
    gitlab = GitlabClient()
    try:
        gitlab.login(get_token(gitlab.url))
    except Unauthorized, e:
        print "Could not authenticate with Gitlab: {}".format(e.message)
        print "It looks like your token is wrong."
        reset_token()
        return get_gitlab()
Example #2
0
def get_gitlab():
    """Return a logged-in instance of the gitlab client.

    Authenticate the client. If the authentication fails with an Unauthorized error,
    ask the user to provide the token again and retry.
    """
    gitlab = GitlabClient()
    try:
        gitlab.login(get_token(gitlab.url))
    except Unauthorized, e:
        print "Could not authenticate with Gitlab: {}".format(e.message)
        print "It looks like your token is wrong."
        reset_token()
        return get_gitlab()
Example #3
0
def auth():
    """Reset the authentication token."""
    reset_token()
Example #4
0
def auth():
    """Reset the authentication token."""
    reset_token()