447
|
|
|
Scott Moser |
8 years ago
|
 |
|
446
|
|
|
Scott Moser |
8 years ago
|
 |
|
445
|
|
|
Scott Moser |
8 years ago
|
 |
|
444
|
|
|
Scott Moser |
8 years ago
|
 |
|
443
|
|
|
Scott Moser |
8 years ago
|
 |
|
442
|
|
|
Scott Moser |
8 years ago
|
 |
|
441
|
|
|
Scott Moser |
8 years ago
|
 |
|
440
|
|
|
Scott Moser |
8 years ago
|
 |
|
439
|
|
|
Robert C Jennings |
8 years ago
|
 |
|
438
|
|
|
Scott Moser |
8 years ago
|
 |
|
437
|
|
|
Robert C Jennings |
8 years ago
|
 |
|
436
|
|
GlanceMirror: fix a couple of race-related problems
First, what can happen is that .sync() is interrupted for external reasons (service restarts, network issues,...) after first image has been uploaded to Glance when syncing multiple images. On re-run, the uploaded image is considered "synced" already, but since simplestreams index is written out only at the end of the sync, all the metadata is lost. We solve this by adding "simplestreams_metadata" as one of the properties of image in Glance where we put a JSON representation of all the metadata fields from the original simplestreams index entry. We then load them in load_products() if they are defined. This results in a slightly different auto.sync.json entry: "endpoint" and "region" are on the product entry, instead of on the disk1.img entry.
Secondly, if sync is indeed interrupted after one or several images are completely uploaded (but not all of them), there's no index file at all, so any attempt to make use of them with juju would fail, even though it should be fully functional. We solve this by calling "insert_products()" at the end of the insert_item(). This means that the index is regenerated after every single image is uploaded.
Along the way, I slightly improve insert_item() tests from the pre-req branch to add a test for minimal data required, rename the existing one using real world data to test_insert_item_full, and re-use that data for a test for a newly added call to insert_products().
|
Scott Moser |
8 years ago
|
 |
|
435
|
|
|
Scott Moser |
8 years ago
|
 |
|
434
|
|
|
Scott Moser |
8 years ago
|
 |
|
433
|
|
|
Scott Moser |
8 years ago
|
 |
|
432
|
|
|
Scott Moser |
8 years ago
|
 |
|
431
|
|
|
Scott Moser |
8 years ago
|
 |
|
430
|
|
|
Robie Basak |
8 years ago
|
 |
|
429
|
|
|
Scott Moser |
8 years ago
|
 |
|
428
|
|
|
Scott Moser |
8 years ago
|
 |
|