Add the basics of geographic data distribution and get the tests to work.
This commit is contained in:
parent
2bf12996f5
commit
bf98575feb
23 changed files with 198 additions and 100 deletions
|
@ -67,8 +67,8 @@ def __create_subtree(repo, structure, creator_username, parent):
|
|||
logger.debug('new docker id: %s' % docker_image_id)
|
||||
checksum = __gen_checksum(docker_image_id)
|
||||
|
||||
new_image = model.find_create_or_link_image(docker_image_id, repo, None,
|
||||
{})
|
||||
new_image = model.find_create_or_link_image(docker_image_id, repo, None, {}, 'local_us')
|
||||
new_image_locations = new_image.storage.locations
|
||||
new_image.storage.uuid = IMAGE_UUIDS[image_num % len(IMAGE_UUIDS)]
|
||||
new_image.storage.uploading = False
|
||||
new_image.storage.checksum = checksum
|
||||
|
@ -89,7 +89,7 @@ def __create_subtree(repo, structure, creator_username, parent):
|
|||
source_diff = SAMPLE_DIFFS[image_num % len(SAMPLE_DIFFS)]
|
||||
|
||||
with open(source_diff, 'r') as source_file:
|
||||
store.stream_write(diff_path, source_file)
|
||||
store.stream_write(new_image_locations, diff_path, source_file)
|
||||
|
||||
parent = new_image
|
||||
|
||||
|
@ -235,6 +235,9 @@ def initialize_database():
|
|||
|
||||
NotificationKind.create(name='test_notification')
|
||||
|
||||
ImageStorageLocation.create(name='local_eu')
|
||||
ImageStorageLocation.create(name='local_us')
|
||||
|
||||
|
||||
def wipe_database():
|
||||
logger.debug('Wiping all data from the DB.')
|
||||
|
|
Reference in a new issue