コード例 #1
0
ファイル: utils.py プロジェクト: Petr2016/product-database
def test_cisco_hello_api_access(client_id, client_secret, drop_credentials=True):
    """
    test the Cisco Hello API access
    """
    try:
        base_api = CiscoHelloApi()
        base_api.load_client_credentials()

        if drop_credentials:
            base_api.drop_cached_token()

        base_api.client_id = client_id
        base_api.client_secret = client_secret

        base_api.hello_api_call()

        return True

    except:
        return False
コード例 #2
0
def check_cisco_hello_api_access(client_id,
                                 client_secret,
                                 drop_credentials=True):
    """
    test the Cisco Hello API access
    """
    try:
        base_api = CiscoHelloApi()
        base_api.load_client_credentials()

        if drop_credentials:
            base_api.drop_cached_token()

        base_api.client_id = client_id
        base_api.client_secret = client_secret

        base_api.hello_api_call()

        return True

    except Exception:
        return False
コード例 #3
0
ファイル: utils.py プロジェクト: thirumald/product-database
def check_cisco_hello_api_access(client_id,
                                 client_secret,
                                 drop_credentials=True):
    """
    test the Cisco Hello API access
    """
    try:
        base_api = CiscoHelloApi()
        base_api.load_client_credentials()

        if drop_credentials:
            base_api.drop_cached_token()

        base_api.client_id = client_id
        base_api.client_secret = client_secret

        base_api.hello_api_call()

        return True

    except Exception as ex:
        logging.error("Cisco Hello API test access failed (%s)" % ex,
                      exc_info=True)
        return False