Commit 178ebee8 authored by eric pellegrini's avatar eric pellegrini
Browse files

updated docstrings

added control for packer existence prior runnin it
parent c9718cdf
......@@ -67,7 +67,7 @@ class PackerTemplate:
Returns
-------
list of packer builders
list
The list of packer builders for this PackerTemplate.
"""
......@@ -115,7 +115,7 @@ class PackerTemplate:
Returns
-------
list of packer postprocessors
list
The list of packer postprocessors for this PackerTemplate.
"""
......@@ -127,7 +127,7 @@ class PackerTemplate:
Returns
-------
list of packer provisioners
list
The list of packer provisioners for this PackerTemplate.
"""
......@@ -139,7 +139,7 @@ class PackerTemplate:
Returns
-------
list of packer variables
list
The list of packer variables for this PackerTemplate.
"""
......@@ -196,7 +196,7 @@ class PackerTemplate:
Parameters
----------
list of str
list
The list of the packages to append.
"""
......
......@@ -14,6 +14,7 @@
import collections
import os
import shutil
import subprocess
import yaml
......@@ -112,8 +113,8 @@ class Packman:
template_name: str
The template on which the hierarchy will be built upon.
hierarchy: list str
The template hierarchy.
hierarchy: list
A list of strings corresponding tot the template hierarchy.
This argument is just used for passing the template hierarchy across recursive calls of this method.
"""
......@@ -141,8 +142,8 @@ class Packman:
Parameters
----------
selected_templates: list of str
List of packer templates.
selected_templates: list, optional
List of strings corresponding to the packer templates from which the hierarchy should be built.
Returns
-------
......@@ -170,10 +171,14 @@ class Packman:
Parameters
----------
selected_templates: list of str, optional
List of packer templates.
selected_templates: list, optional
List of strings corresponding to the packer templates to ru with packer.
"""
# Check first that packer program is installed somewhere
if shutil.which("packer") is None:
raise FileNotFoundError("packer could not be found.")
# Set env variables for packer run environment
packer_env = os.environ.copy()
# This allow to speed up the typing of the preseed command line
......@@ -215,8 +220,8 @@ class Packman:
Parameters
----------
selected_templates: list of str, optional
List of packer templates.
selected_templates: list, optional
List of strings corresponding to the packer templates to build.
run: bool, optional
If True packer will be run from the generated manifest.json files.
......
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