Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
58ef43f6
Commit
58ef43f6
authored
Jan 27, 2025
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slap/slap.py: software release
parent
9665b9c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
13 deletions
+31
-13
slapos/slap/slap.py
slapos/slap/slap.py
+31
-13
No files found.
slapos/slap/slap.py
View file @
58ef43f6
...
...
@@ -197,7 +197,7 @@ class SoftwareRelease(SlapDocument):
{
'url'
:
self
.
getURI
(),
'computer_id'
:
self
.
getComputerId
(),
'error_log'
:
error_log
'error_log'
:
str
(
error_log
)
}
)
except
(
RequestException
,
ConnectionError
):
...
...
@@ -206,22 +206,40 @@ class SoftwareRelease(SlapDocument):
(
logger
or
fallback_logger
).
exception
(
''
)
def
available
(
self
):
if
getattr
(
self
,
'_known_state'
,
'unknown'
)
!=
"available"
:
# Not required to repost if not needed.
self
.
_connection_helper
.
POST
(
'availableSoftwareRelease'
,
data
=
{
'url'
:
self
.
getURI
(),
'computer_id'
:
self
.
getComputerId
()})
# if getattr(self, '_known_state', 'unknown') != "available":
# Not required to repost if not needed.
self
.
_connection_helper
.
callJsonRpcAPI
(
'slapos.put.software_installation'
,
{
"portal_type"
:
"Software Installation"
,
'computer_id'
:
self
.
getComputerId
(),
'software_release_uri'
:
self
.
getURI
(),
'reported_state'
:
'available'
}
)
def
building
(
self
):
if
getattr
(
self
,
'_known_state'
,
'unknown'
)
!=
"building"
:
self
.
_connection_helper
.
POST
(
'buildingSoftwareRelease'
,
data
=
{
'url'
:
self
.
getURI
(),
'computer_id'
:
self
.
getComputerId
()})
# if getattr(self, '_known_state', 'unknown') != "building":
self
.
_connection_helper
.
callJsonRpcAPI
(
'slapos.put.software_installation'
,
{
"portal_type"
:
"Software Installation"
,
'computer_id'
:
self
.
getComputerId
(),
'software_release_uri'
:
self
.
getURI
(),
'reported_state'
:
'building'
}
)
def
destroyed
(
self
):
self
.
_connection_helper
.
POST
(
'destroyedSoftwareRelease'
,
data
=
{
'url'
:
self
.
getURI
(),
'computer_id'
:
self
.
getComputerId
()})
self
.
_connection_helper
.
callJsonRpcAPI
(
'slapos.put.software_installation'
,
{
"portal_type"
:
"Software Installation"
,
'computer_id'
:
self
.
getComputerId
(),
'software_release_uri'
:
self
.
getURI
(),
'reported_state'
:
'destroyed'
}
)
def
getState
(
self
):
return
getattr
(
self
,
'_requested_state'
,
'available'
)
...
...
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