Пример #1
0
def cert_cache_dir( config, volume_name_or_id, gateway_name_or_id ):
    """
    Calculate the path to the cached certificate state for this gateway.
    """
   
    cert_dir = conf.object_file_path( config, "certs", "" )
    cert_dir = os.path.join( cert_dir, str(volume_name_or_id), str(gateway_name_or_id) )
    return cert_dir
Пример #2
0
def cert_cache_dir(config, volume_name_or_id, gateway_name_or_id):
    """
    Calculate the path to the cached certificate state for this gateway.
    """

    cert_dir = conf.object_file_path(config, "certs", "")
    cert_dir = os.path.join(cert_dir, str(volume_name_or_id),
                            str(gateway_name_or_id))
    return cert_dir
Пример #3
0
def list_pkey_paths(config, object_type):
    """
    List all private keys that we have generated ourselves, for a particular object type
    """
    pkey_dir = conf.object_file_path(config, object_type, "")
    listing = os.listdir(pkey_dir)
    ret = []

    for name in listing:
        if name in [".", ".."]:
            continue

        if not name.endswith(".pkey"):
            continue

        ret.append(os.path.join(pkey_dir, name))

    return ret
Пример #4
0
def list_pkey_paths( config, object_type ):
    """
    List all private keys that we have generated ourselves, for a particular object type
    """
    pkey_dir = conf.object_file_path( config, object_type, "" )
    listing = os.listdir( pkey_dir )
    ret = []

    for name in listing:
        if name in [".", ".."]:
            continue 

        if not name.endswith(".pkey"):
            continue 

        ret.append( os.path.join(pkey_dir, name))

    return ret
Пример #5
0
def list_cert_paths(config, object_type):
    """
    List all certs that we have generated ourselves, for a particular object type
    """
    cert_dir = conf.object_file_path(config, object_type, "")
    listing = os.listdir(cert_dir)
    ret = []

    for name in listing:
        if name in [".", ".."]:
            continue

        if not name.endswith(".cert"):
            continue

        object_id_str = name[:-5]
        try:
            object_id = int(object_id_str)
        except Exception:
            continue

        ret.append(os.path.join(cert_dir, name))

    return ret
Пример #6
0
def list_cert_paths( config, object_type ):
    """
    List all certs that we have generated ourselves, for a particular object type
    """
    cert_dir = conf.object_file_path( config, object_type, "" )
    listing = os.listdir( cert_dir )
    ret = []

    for name in listing:
        if name in [".", ".."]:
            continue 

        if not name.endswith(".cert"):
            continue 

        object_id_str = name[:-5]
        try:
            object_id = int(object_id_str)
        except:
            continue

        ret.append( os.path.join(cert_dir, name ) )

    return ret