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
Titouan Soulard
slapos
Commits
71b35322
Commit
71b35322
authored
Oct 03, 2023
by
Titouan Soulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cookbook: allow using new api for recipes
parent
464bbbdb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
slapos/recipe/librecipe/genericjioapi.py
slapos/recipe/librecipe/genericjioapi.py
+4
-2
slapos/recipe/request.py
slapos/recipe/request.py
+7
-3
No files found.
slapos/recipe/librecipe/genericjioapi.py
View file @
71b35322
...
...
@@ -54,6 +54,7 @@ class GenericjIOAPIRecipe(GenericBaseRecipe):
self
.
computer_id
=
slap_connection
[
'computer-id'
]
self
.
computer_partition_id
=
slap_connection
[
'partition-id'
]
self
.
server_url
=
slap_connection
[
'server-url'
]
self
.
slapgrid_jio_uri
=
slap_connection
[
'slapgrid-jio-uri'
]
self
.
software_release_url
=
slap_connection
[
'software-release-url'
]
self
.
key_file
=
slap_connection
.
get
(
'key-file'
)
self
.
cert_file
=
slap_connection
.
get
(
'cert-file'
)
...
...
@@ -72,8 +73,9 @@ class GenericjIOAPIRecipe(GenericBaseRecipe):
with
open
(
self
.
instance_json_path
,
"r"
)
as
f
:
self
.
computer_partition
=
json
.
load
(
f
)
self
.
slap
.
initializeConnection
(
self
.
server_url
,
self
.
key_file
,
self
.
cert_file
)
self
.
slap
.
initializeConnection
(
self
.
server_url
,
key_file
=
self
.
key_file
,
cert_file
=
self
.
cert_file
,
slapgrid_jio_uri
=
self
.
slapgrid_jio_uri
)
# Fallback to requesting to SlapOS Master
if
not
self
.
computer_partition
:
...
...
slapos/recipe/request.py
View file @
71b35322
...
...
@@ -127,7 +127,10 @@ class Recipe(object):
# By default, propagate the state of the parent instance
# Except if parent is destroyed, as it may lead to the unexpected
# destruction of the full instance tree
default_state
=
buildout
[
'slap-connection'
].
get
(
'requested'
,
'started'
)
slap_connection
=
buildout
[
'slap-connection'
]
default_state
=
slap_connection
.
get
(
'requested'
,
'started'
)
slapgrid_jio_uri
=
slap_connection
.
get
(
'slapgrid-jio-uri'
,
None
)
if
default_state
not
in
(
'started'
,
'stopped'
):
default_state
=
'started'
requested_state
=
options
.
get
(
'state'
,
default_state
)
...
...
@@ -136,8 +139,9 @@ class Recipe(object):
slap
=
slapmodule
.
slap
()
slap
.
initializeConnection
(
options
[
'server-url'
],
options
.
get
(
'key-file'
),
options
.
get
(
'cert-file'
),
key_file
=
options
.
get
(
'key-file'
),
cert_file
=
options
.
get
(
'cert-file'
),
slapgrid_jio_uri
=
slapgrid_jio_uri
,
)
if
not
slap
.
jio_api_connector
:
request
=
slap
.
registerComputerPartition
(
...
...
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