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
def get_user_meta(user): try: return { get_meta_name(key): value for key, value in json.loads(user['userDesc']).iteritems() } except Exception: return {}
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
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