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
97b49706
Commit
97b49706
authored
Jan 17, 2020
by
eric pellegrini
Browse files
renamed variable(s) for better readability
parent
48f71cb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/packme/Packman.py
View file @
97b49706
...
...
@@ -24,7 +24,7 @@ class Packman:
"""This class implements the Packman engine for generating packer template json files and run packer optionally .
"""
def
__init__
(
self
,
input_file
,
templates_dir
):
def
__init__
(
self
,
input_file
,
templates_
base_
dir
):
"""Constructor.
Parameters
...
...
@@ -34,7 +34,7 @@ class Packman:
"""
# The base directory for templates
self
.
_templates_dir
=
os
.
path
.
abspath
(
templates_dir
)
self
.
_templates_
base_
dir
=
os
.
path
.
abspath
(
templates_
base_
dir
)
with
open
(
input_file
,
"r"
)
as
fin
:
data
=
yaml
.
safe_load
(
fin
)
...
...
@@ -81,7 +81,7 @@ class Packman:
template_node
=
self
.
get_template
(
template_name
)
# Build the path for the template manifest file (YAML)
manifest_file
=
os
.
path
.
join
(
self
.
_templates_dir
,
template_name
,
"manifest.yml"
)
manifest_file
=
os
.
path
.
join
(
self
.
_templates_
base_
dir
,
template_name
,
"manifest.yml"
)
# Opens the file and load its contents
try
:
...
...
@@ -196,7 +196,7 @@ class Packman:
for
template
in
config_hierarchy
:
# cd to the the template directory
current_template_dir
=
os
.
path
.
join
(
self
.
_templates_dir
,
template
)
current_template_dir
=
os
.
path
.
join
(
self
.
_templates_
base_
dir
,
template
)
build_dir
=
os
.
path
.
join
(
current_template_dir
,
"builds"
,
template
)
...
...
@@ -246,6 +246,6 @@ class Packman:
template
.
set_parent
(
parent_template
)
# Dump the template
ouput_file
=
os
.
path
.
join
(
self
.
_templates_dir
,
template_name
,
"manifest.json"
)
ouput_file
=
os
.
path
.
join
(
self
.
_templates_
base_
dir
,
template_name
,
"manifest.json"
)
template
.
dump
(
ouput_file
,
**
kwargs
)
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