Page MenuHome

storage.py
No OneTemporary

storage.py

import requests
import os
from pillar.web.utils import system_util
class StorageNode(object):
path = "storage"
def __init__(self, storage_node):
self.storage_node = storage_node
@property
def entrypoint(self):
return os.path.join(
system_util.pillar_server_endpoint(),
self.path,
self.storage_node.properties.backend,
self.storage_node.properties.project,
self.storage_node.properties.subdir)
# @current_app.cache.memoize(timeout=3600)
def browse(self, path=None):
"""Search a storage node for a path, which can point both to a directory
of to a file.
"""
if path is None:
url = self.entrypoint
else:
url = os.path.join(self.entrypoint, path)
r = requests.get(url)
return r.json()

File Metadata

Mime Type
text/x-python
Expires
Sat, May 28, 6:59 AM (2 d)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
8c/a6/ecceb3463927abe9a61137a506a5

Event Timeline