Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
0
Merge Requests
0
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
Lisa Casino
slapos
Commits
023f86d5
Commit
023f86d5
authored
Jun 25, 2021
by
Lisa Casino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recipe/switch_softwaretype: add log
parent
9635c705
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
slapos/recipe/switch_softwaretype.py
slapos/recipe/switch_softwaretype.py
+22
-3
software/html5as/buildout.hash.cfg
software/html5as/buildout.hash.cfg
+1
-1
No files found.
slapos/recipe/switch_softwaretype.py
View file @
023f86d5
...
@@ -25,9 +25,8 @@
...
@@ -25,9 +25,8 @@
#
#
##############################################################################
##############################################################################
from
zc.buildout.buildout
import
Buildout
from
zc.buildout.buildout
import
Buildout
from
zc.buildout
import
UserError
class
SubBuildout
(
Buildout
):
class
SubBuildout
(
Buildout
):
"""Run buildout in buildout, partially copied from infrae.buildout
"""Run buildout in buildout, partially copied from infrae.buildout
...
@@ -52,6 +51,8 @@ class SubBuildout(Buildout):
...
@@ -52,6 +51,8 @@ class SubBuildout(Buildout):
opt
,
opt
,
main_buildout
[
'buildout'
][
opt
],
main_buildout
[
'buildout'
][
opt
],
))
))
if
not
(
"slap-connection"
in
main_buildout
):
raise
UserError
(
"You should use slap-connection in the section [slap-configuration]."
)
# Use same slap connection
# Use same slap connection
for
k
,
v
in
main_buildout
[
"slap-connection"
].
items
():
for
k
,
v
in
main_buildout
[
"slap-connection"
].
items
():
options
.
append
((
'slap-connection'
,
k
,
v
))
options
.
append
((
'slap-connection'
,
k
,
v
))
...
@@ -71,8 +72,26 @@ class Recipe:
...
@@ -71,8 +72,26 @@ class Recipe:
self
.
buildout
=
buildout
self
.
buildout
=
buildout
self
.
options
=
options
self
.
options
=
options
self
.
name
=
name
self
.
name
=
name
if
not
(
"slap-configuration"
in
self
.
buildout
)
or
not
(
"slap-software-type"
in
buildout
[
"slap-configuration"
]):
raise
UserError
(
"You should have a section [slap-configuration] with "
\
"this recipe: slapos.cookbook:slapconfiguration."
)
self
.
software_type
=
buildout
[
"slap-configuration"
][
"slap-software-type"
]
self
.
software_type
=
buildout
[
"slap-configuration"
][
"slap-software-type"
]
if
self
.
software_type
not
in
self
.
options
:
raise
UserError
(
"This software type (%s) isn't mapped. RootSoftwareInstance "
\
"is the default software type."
%
self
.
software_type
)
try
:
section
,
key
=
self
.
options
[
self
.
software_type
].
split
(
":"
)
section
,
key
=
self
.
options
[
self
.
software_type
].
split
(
":"
)
except
:
raise
UserError
(
"The softwares types in the section [%s] must be separate "
\
"by a colon such as: 'section:key', where key is usually 'rendered'. "
\
"Don't use: ${section:key}"
%
self
.
name
)
if
not
(
section
in
self
.
buildout
):
raise
UserError
(
"The section %s can't be found in the file."
%
section
)
elif
not
(
key
in
buildout
[
section
]):
raise
UserError
(
"The key %s can't be found in the section %s."
%
(
key
,
section
))
self
.
base
=
self
.
buildout
[
section
][
key
]
self
.
base
=
self
.
buildout
[
section
][
key
]
def
install
(
self
):
def
install
(
self
):
...
...
software/html5as/buildout.hash.cfg
View file @
023f86d5
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
[template-cfg]
[template-cfg]
filename = instance.cfg.in
filename = instance.cfg.in
md5sum = c
af9bd63a7d92b2af18b200611e42221
md5sum = c
9d39e620b6a8ff59e959a6c277b3def
[instance_html5as]
[instance_html5as]
_update_hash_filename_ = instance_html5as.cfg.in
_update_hash_filename_ = instance_html5as.cfg.in
...
...
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