uncloud-mravi/uncloud/api/create_image_store.py
Nico Schottelius 433a3b9817 refactor #2
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2019-12-31 11:30:02 +01:00

20 lines
429 B
Python
Executable file

import json
import os
from uuid import uuid4
from uncloud.shared import shared
from uncloud.settings import settings
data = {
"is_public": True,
"type": "ceph",
"name": "images",
"description": "first ever public image-store",
"attributes": {"list": [], "key": [], "pool": "images"},
}
shared.etcd_client.put(
os.path.join(settings["etcd"]["image_store_prefix"], uuid4().hex),
json.dumps(data),
)