Commit d9210dd5 by Guba Sándor

driver: added list_files function

parent 623d1db1
from disk import Disk
from storagecelery import celery
from os import path, unlink, statvfs
from os import path, unlink, statvfs, listdir, mkdir
from shutil import move
from celery.contrib.abortable import AbortableTask
import logging
logger = logging.getLogger(__name__)
trash_directory = "trash"
@celery.task()
......@@ -10,6 +16,12 @@ def list(dir):
@celery.task()
def list_files(datastore):
return [l for l in listdir(datastore) if
path.isfile(path.join(datastore, l))]
@celery.task()
def create(disk_desc):
disk = Disk.deserialize(disk_desc)
disk.create()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment