From 1ad68c447228db61fd1317bc3a161fb883250817 Mon Sep 17 00:00:00 2001 From: Artur Svechnikov Date: Thu, 17 Dec 2015 10:56:10 +0300 Subject: [PATCH] Add centos bootstrap to fuel-bootstrap-cli list Change-Id: Ie9be1afb40209ae8703cddfaf39d6cd3a8e82905 Closes-Bug: #1527494 --- .../fuel_bootstrap/utils/bootstrap_image.py | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/utils/bootstrap_image.py b/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/utils/bootstrap_image.py index 9093929b..253cdc10 100644 --- a/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/utils/bootstrap_image.py +++ b/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/utils/bootstrap_image.py @@ -16,6 +16,7 @@ import logging import os +import re import shutil import tarfile import tempfile @@ -37,6 +38,12 @@ ACTIVE = 'active' def get_all(): + """Return info about all valid bootstrap images + + :return: array of dict + """ + # TODO(asvechnikov): need to change of determining active bootstrap + # cobbler profile must be used data = [] LOG.debug("Searching images in %s", CONF.bootstrap_images_dir) for name in os.listdir(CONF.bootstrap_images_dir): @@ -46,9 +53,32 @@ def get_all(): data.append(parse(name)) except errors.IncorrectImage as e: LOG.debug("Image [%s] is skipped due to %s", name, e) + data.append(get_centos_data()) return data +def _cobbler_profile(): + """Parse current active profile from cobbler system + + :return: string + """ + + stdout, _ = utils.execute('dockerctl', 'shell', 'cobbler', 'cobbler', + 'system', 'report', '--name', 'default') + regex = r"(?P