Commit 8c6c7e46 authored by eric pellegrini's avatar eric pellegrini
Browse files

added TemplatesSelectionError class

parent 4cb4d3a3
......@@ -8,6 +8,9 @@ from typing import Any, Dict, List, Optional
from .PackerTemplate import PackerTemplate
class TemplatesSelectionError(Exception):
class Packman:
"""This class implements the Packman engine for generating packer template json files and run packer optionally .
......@@ -59,6 +62,9 @@ class Packman:
# Filter out the image names not present in the yaml file
templates = [template for template in selected_templates if template in self._templates]
if not selected_templates:
raise TemplatesSelectionError("Empty templates selection")
return templates
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