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 5c1dd7e6..6ce60175 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