parent
1ddc73416c
commit
12924784ce
6 changed files with 93 additions and 12 deletions
14
util/registry/replication.py
Normal file
14
util/registry/replication.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
import features
|
||||
import json
|
||||
from data import model
|
||||
|
||||
from app import image_replication_queue
|
||||
|
||||
def queue_storage_replication(namespace, storage):
|
||||
""" Queues replication for the given image storage under the given namespace (if enabled). """
|
||||
if features.STORAGE_REPLICATION:
|
||||
namespace_user = model.user.get_namespace_user(namespace)
|
||||
image_replication_queue.put([storage.uuid], json.dumps({
|
||||
'namespace_user_id': namespace_user.id,
|
||||
'storage_id': storage.uuid,
|
||||
}))
|
Reference in a new issue