From 379fbf722475551dc96030d6e836e151e821f439 Mon Sep 17 00:00:00 2001
From: Claudio Pisa <claudio.pisa@garr.it>
Date: Thu, 21 Feb 2019 17:38:24 +0100
Subject: [PATCH] 2019-02-21: CP; add metadata to config.yml for simplestream

---
 config.yml       | 6 ++++++
 update-images.py | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/config.yml b/config.yml
index 3c23771..95c4df5 100644
--- a/config.yml
+++ b/config.yml
@@ -74,6 +74,9 @@ images:
     - "architecture=x86_64"
     - "os_require_quiesce=yes"
     - "hw_qemu_guest_agent=yes"
+  ubuntu-12.04:
+    name: Ubuntu 12.04 - GARR
+    simplestreams: com.ubuntu.cloud:server:12.04:amd64
   ubuntu-14.04:
     name: Ubuntu 14.04 - GARR
     url: https://cloud-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img
@@ -88,6 +91,7 @@ images:
     - "architecture=amd64"
     - "os_require_quiesce=yes"
     - "hw_qemu_guest_agent=yes"
+    simplestreams: com.ubuntu.cloud:server:14.04:amd64
   ubuntu-16.04:
     name: Ubuntu 16.04 - GARR
     url: https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img
@@ -104,6 +108,7 @@ images:
     - "hw_qemu_guest_agent=yes"
     - "hw_vif_multiqueue_enabled=true"
     - "hw_rng_model=virtio"
+    simplestreams: com.ubuntu.cloud:server:16.04:amd64
   ubuntu-18.04:
     name: Ubuntu 18.04 - GARR
     url: http://cloud-images.ubuntu.com/releases/18.04/release/ubuntu-18.04-server-cloudimg-amd64.img
@@ -120,3 +125,4 @@ images:
     - "hw_qemu_guest_agent=yes"
     - "hw_vif_multiqueue_enabled=true"
     - "hw_rng_model=virtio"
+    simplestreams: com.ubuntu.cloud:server:18.04:amd64
diff --git a/update-images.py b/update-images.py
index b0ad961..3207efa 100755
--- a/update-images.py
+++ b/update-images.py
@@ -41,6 +41,9 @@ openstack_cloud_connection = shade.openstack_cloud()
 
 for image_key in sorted(config['images'].keys()):
     print("=== Image name: {}".format(image_key))
+    if not 'url' in config['images'][image_key]:
+        print("skipping...")
+        continue
     url = config['images'][image_key]['url']
     request_response = requests_session.head(url, allow_redirects=True)
     request_response.raise_for_status()
-- 
GitLab