Commit 96e475f1 authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis Committed by Christos Stavrakakis
Browse files

ci: turn system_uuid option into a hardcoded one

User doesn't need to specify the UUID of the owner of
system images (it's usually hard to find it).

Instead save the uuids for these users for our production and
testing deployments inside a list (DEFAULT_SYSTEM_IMAGES_UUID) and
use that (uuids never change). If you need to specify another user
it's preferable to specify the image_id using the corresponding option.
parent f3368048
......@@ -19,8 +19,6 @@ patch_pydist = True
# Configuration of git (on remote server)
git_config_name = Buildbot
git_config_mail =
# Url to fetch ssh public keys
public_ssh_keys_url =
# Network address from which we allow access to server. If not set, access
# to server is not restricted.
filter_access_network =
......@@ -38,10 +36,6 @@ server_name = Synnefo Deployment
flavor_id = 639
# Image to use (name must contain this)
image_name = OldStable
# UUID of owner of system images
# (25ecced9-bf53-4145-91ee-cf47377e9fb2 for production,
# 04cbe33f-29b7-4ef1-94fb-015929e5fc06 for
system_uuid = 04cbe33f-29b7-4ef1-94fb-015929e5fc06
......@@ -19,6 +19,11 @@ from kamaki.clients.cyclades import CycladesClient
from kamaki.clients.image import ImageClient
DEFAULT_CONFIG_FILE = "new_config"
# UUID of owner of system images
"25ecced9-bf53-4145-91ee-cf47377e9fb2", # production (
"04cbe33f-29b7-4ef1-94fb-015929e5fc06", # testing (
def _run(cmd, verbose):
......@@ -249,17 +254,17 @@ class SynnefoCI(object):
def _find_image(self):
"""Find a suitable image to use
It has to belong to the `system_uuid' user and
contain the word `image_name'
It has to belong to one of the `DEFAULT_SYSTEM_IMAGES_UUID'
users and contain the word given by `image_name' option.
system_uuid = self.config.get('Deployment', 'system_uuid')
image_name = self.config.get('Deployment', 'image_name').lower()
images = self.image_client.list_public(detail=True)['images']
# Select images by `system_uuid' user
images = [x for x in images if x['user_id'] == system_uuid]
images = [x for x in images
if x['user_id'] in DEFAULT_SYSTEM_IMAGES_UUID]
# Select images with `image_name' in their names
images = \
[x for x in images if x['name'].lower().find(image_name) != -1]
images = [x for x in images
if x['name'].lower().find(image_name) != -1]
# Let's select the first one
return images[0]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment