(bless_config)
return cached_data
Load cached AWS credentials for the user that has recently MFA'ed
    Args:
        bless_config (BlessConfig): Loaded BlessConfig
    Return:
        dict of AWS credentials, or {} if no current credentials are found
Load cached AWS credentials for the user that has recently MFA'ed
    Args:
        bless_config (BlessConfig): Loaded BlessConfig
    Return:
        dict of AWS credentials, or {} if no current credentials are found
Load cached AWS credentials for the user that has recently MFA ed Args : bless_config ( BlessConfig ) : Loaded BlessConfig Return : dict of AWS credentials or {} if no current credentials are found
def load_cached_creds(bless_config):
    """ Load cached AWS credentials for the user that has recently MFA'ed
    Args:
        bless_config (BlessConfig): Loaded BlessConfig
    Return:
        dict of AWS credentials, or {} if no current credentials are found
    """
    client_config = bless_config.get_client_config()
    cachedir = os.path.join(
        os.getenv(
            'HOME',
            os.getcwd()),
        client_config['mfa_cache_dir'])
    cache_file_path = os.path.join(cachedir, client_config['mfa_cache_file'])
    if not os.path.isfile(cache_file_path):
        return {}

    cached_data = {}
    with open(cache_file_path, 'r') as cache:
        cached_data = uncache_creds(json.load(cache))
        if cached_data['Expiration'] < time.gmtime():
            cached_data = {}
    return cached_data
def load_cached_creds ( bless_config ) : client_config = bless_config . get_client_config ( ) cachedir = os . path . join ( os . getenv ( 'HOME' , os . getcwd ( ) ) , client_config [ 'mfa_cache_dir' ] ) cache_file_path = os . path . join ( cachedir , client_config [ 'mfa_cache_file' ] ) if not os . path . isfile ( cache_file_path ) : return { } cached_data = { } with open ( cache_file_path , 'r' ) as cache : cached_data = uncache_creds ( json . load ( cache ) ) if cached_data [ 'Expiration' ] < time . gmtime ( ) : cached_data = { } return cached_data