2019-10-25 06:42:40 +00:00
|
|
|
import json
|
|
|
|
import os
|
2019-12-03 11:49:10 +00:00
|
|
|
|
2019-10-25 06:42:40 +00:00
|
|
|
from uuid import uuid4
|
|
|
|
|
2019-12-31 10:30:02 +00:00
|
|
|
from uncloud.shared import shared
|
|
|
|
from uncloud.settings import settings
|
2019-10-25 06:42:40 +00:00
|
|
|
|
|
|
|
data = {
|
2020-01-05 13:31:48 +00:00
|
|
|
'is_public': True,
|
|
|
|
'type': 'ceph',
|
|
|
|
'name': 'images',
|
|
|
|
'description': 'first ever public image-store',
|
|
|
|
'attributes': {'list': [], 'key': [], 'pool': 'images'},
|
2019-10-25 06:42:40 +00:00
|
|
|
}
|
|
|
|
|
2019-12-30 09:35:07 +00:00
|
|
|
shared.etcd_client.put(
|
2020-01-05 13:31:48 +00:00
|
|
|
os.path.join(settings['etcd']['image_store_prefix'], uuid4().hex),
|
2019-12-30 09:35:07 +00:00
|
|
|
json.dumps(data),
|
|
|
|
)
|