Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PaNOSC
Data Analysis Services
packme
Commits
8c6c7e46
Commit
8c6c7e46
authored
Jan 28, 2020
by
eric pellegrini
Browse files
added TemplatesSelectionError class
parent
4cb4d3a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/packme/Packman.py
View file @
8c6c7e46
...
@@ -8,6 +8,9 @@ from typing import Any, Dict, List, Optional
...
@@ -8,6 +8,9 @@ from typing import Any, Dict, List, Optional
from
.PackerTemplate
import
PackerTemplate
from
.PackerTemplate
import
PackerTemplate
class
TemplatesSelectionError
(
Exception
):
pass
class
Packman
:
class
Packman
:
"""This class implements the Packman engine for generating packer template json files and run packer optionally .
"""This class implements the Packman engine for generating packer template json files and run packer optionally .
"""
"""
...
@@ -59,6 +62,9 @@ class Packman:
...
@@ -59,6 +62,9 @@ class Packman:
else
:
else
:
# Filter out the image names not present in the yaml file
# Filter out the image names not present in the yaml file
templates
=
[
template
for
template
in
selected_templates
if
template
in
self
.
_templates
]
templates
=
[
template
for
template
in
selected_templates
if
template
in
self
.
_templates
]
if
not
selected_templates
:
raise
TemplatesSelectionError
(
"Empty templates selection"
)
return
templates
return
templates
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment