Add more volume file operations and cleanup k8s provider code

This commit is contained in:
Joseph Schorr 2016-12-09 17:37:26 -05:00
parent 29d6abddb5
commit f1c9965edf
3 changed files with 49 additions and 25 deletions

View file

@ -59,6 +59,17 @@ class FileConfigProvider(BaseProvider):
return filepath
def remove_volume_file(self, filename):
filepath = os.path.join(self.config_volume, filename)
os.remove(filepath)
def list_volume_directory(self, path):
dirpath = os.path.join(self.config_volume, path)
if not os.path.exists(dirpath):
return None
return os.listdir(dirpath)
def save_volume_file(self, filename, flask_file):
filepath = os.path.join(self.config_volume, filename)
try: