Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nxd-bom
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
nxd-bom
Commits
0680119c
Commit
0680119c
authored
Jun 03, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support old options of slapos.recipe.template
parent
9cbc4621
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
8 deletions
+47
-8
nxdbom/__init__.py
nxdbom/__init__.py
+17
-8
nxdbom/nxdbom_test.py
nxdbom/nxdbom_test.py
+30
-0
No files found.
nxdbom/__init__.py
View file @
0680119c
...
...
@@ -172,18 +172,27 @@ def bom_software(installed_software_path): # -> {} (name,kind) -> PkgInfo
elif
recipe
.
startswith
(
'slapos.recipe.template'
)
or
\
recipe
==
'collective.recipe.template'
:
url
=
geturl
(
part
,
None
)
if
url
is
not
None
:
if
isconf
(
url
):
continue
# NOTE binary is not expected with slapos.recipe.template
raise
ValueError
(
'%s uses %s with url that does not look like a .conf file: %s'
%
(
s
,
recipe
,
url
))
else
:
# it is an inline= script
if
url
is
None
:
if
recipe
.
startswith
(
'slapos'
):
assert
'inline'
in
part
,
part
# old slapos.recipe.template option
url
=
part
.
get
(
'template'
,
raw
=
True
)
if
url
is
None
:
# it is an inline= script
if
'inline'
in
part
:
continue
# old versions of slapos.recipe.template did not save the url in options
if
'slapos.recipe.template-4'
in
part
.
get
(
'__buildout_signature__'
,
raw
=
True
,
fallback
=
''
):
continue
raise
ValueError
(
'No url for %s'
%
part
)
if
url
.
startswith
(
'inline:'
):
continue
else
:
# collective...
assert
part
[
'input'
].
startswith
(
'inline:'
)
if
url
is
None
or
isconf
(
url
):
continue
# NOTE binary is not expected with slapos.recipe.template
raise
ValueError
(
'%s uses %s with url that does not look like a .conf file: %s'
%
(
s
,
recipe
,
url
))
elif
recipe
in
(
'zc.recipe.egg:custom'
,
'zc.recipe.egg:develop'
):
eggpath
=
part
[
'__buildout_installed__'
]
...
...
nxdbom/nxdbom_test.py
View file @
0680119c
...
...
@@ -273,6 +273,36 @@ recipe = collective.recipe.template
input = inline: zzz
"""
,
''
)
# inline ignore
# legacy options (template & rendered) for slapos.recipe.template
case1
(
"""
\
[matplotlibrc]
recipe = slapos.recipe.template:jinja2
rendered = /ROOT/parts/matplotlibrc/matplotlibrc
template = https://lab.nexedi.com/nexedi/slapos/raw/1.0.167.10/component/matplotlib/matplotlibrc.in
"""
,
''
)
case1
(
"""
\
[randomsleep]
recipe = slapos.recipe.template:jinja2
template = inline:x
"""
,
''
)
case1
(
"""
\
[randomsleep]
recipe = slapos.recipe.template
template = inline:x
"""
,
''
)
# slapos.recipe.template < 5 removed url from options
case1
(
"""
\
[template-fonts-conf]
recipe = slapos.recipe.template
__buildout_signature__ = Jinja2-2.9.5 MarkupSafe-1.0 setuptools-44.0.0 six-1.12.0 slapos.recipe.template-4.4 zc.buildout-2.7.1+slapos009 gcc:f7deef0474b0074beef57c09c3a00152
filename = fonts.conf.in
md5sum = 6967e553630d107fc0a59b14de8b0251
mode = 640
output = /srv/slapgrid/slappart15/srv/runner/instance/slappart7/tmp/soft/401a9f2389413c4c542be71a6c8a3a39/parts/template-fonts-conf
"""
,
''
)
case1
(
"""
\
[neoppod-develop]
...
...
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