226
227
maaslog.warn("Can't import: no Simplestreams sources selected.")
229
# We download the keyrings now because we need them for both
230
# download_all_image_descriptions() and
231
# download_all_boot_resources() later.
232
sources = write_all_keyrings(sources)
234
image_descriptions = download_all_image_descriptions(sources)
235
if image_descriptions.is_empty():
237
"No boot resources found. "
238
"Check sources specification and connectivity.")
241
storage = provisioningserver.config.BOOT_RESOURCES_STORAGE
242
meta_file_content = image_descriptions.dump_json()
243
if meta_contains(storage, meta_file_content):
244
# The current maas.meta already contains the new config. No need to
248
product_mapping = map_products(image_descriptions)
250
snapshot_path = download_all_boot_resources(
251
sources, storage, product_mapping)
230
with tempdir('keyrings') as keyrings_path:
231
# We download the keyrings now because we need them for both
232
# download_all_image_descriptions() and
233
# download_all_boot_resources() later.
234
sources = write_all_keyrings(keyrings_path, sources)
236
image_descriptions = download_all_image_descriptions(sources)
237
if image_descriptions.is_empty():
239
"No boot resources found. "
240
"Check sources specification and connectivity.")
243
storage = provisioningserver.config.BOOT_RESOURCES_STORAGE
244
meta_file_content = image_descriptions.dump_json()
245
if meta_contains(storage, meta_file_content):
246
# The current maas.meta already contains the new config. No need
247
# to rewrite anything.
250
product_mapping = map_products(image_descriptions)
252
snapshot_path = download_all_boot_resources(
253
sources, storage, product_mapping)
253
255
maaslog.info("Writing metadata and iSCSI targets.")
254
256
write_snapshot_metadata(snapshot_path, meta_file_content)