예제 #1
0
def get_volume_meta(vol_name):
    volume = get_volume_object(vol_name)
    meta = {
        get_meta_name(key): value.decode('hex')
        for key, value in volume['customVolumeMeta'].iteritems()
    }
    meta.pop('__SXSWIFT__', None)
    return meta
예제 #2
0
def get_user_meta(user):
    try:
        return {
            get_meta_name(key): value
            for key, value in json.loads(user['userDesc']).iteritems()
        }
    except Exception:
        return {}
예제 #3
0
파일: accounts.py 프로젝트: rmayhue/sxswift
def get_user_meta(user):
    try:
        return {
            get_meta_name(key): value
            for key, value in json.loads(user['userDesc']).iteritems()
        }
    except Exception:
        return {}
예제 #4
0
파일: common.py 프로젝트: rmayhue/sxswift
def get_metadata(vol, obj):
    sxcontroller = get_sxcontroller()
    try:
        resp = sxcontroller.getFileMeta.json_call(vol, obj)
    except SXClusterNotFound:
        raise NotFound
    except SXClusterFatalError:
        raise Conflict

    metas = {}
    for key, value in resp['fileMeta'].iteritems():
        key = str(get_meta_name(key))
        metas[key] = value.decode('hex')
    return metas
예제 #5
0
파일: common.py 프로젝트: skylable/sxswift
def get_metadata(vol, obj):
    sxcontroller = get_sxcontroller()
    try:
        resp = sxcontroller.getFileMeta.json_call(vol, obj)
    except SXClusterNotFound:
        raise NotFound
    except SXClusterFatalError:
        raise Conflict

    metas = {}
    for key, value in resp['fileMeta'].iteritems():
        key = str(get_meta_name(key))
        metas[key] = value.decode('hex')
    return metas
예제 #6
0
def get_volume_meta(vol_name):
    volume = get_volume_object(vol_name)
    meta = {get_meta_name(key): value.decode("hex") for key, value in volume["customVolumeMeta"].iteritems()}
    meta.pop("__SXSWIFT__", None)
    return meta