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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
939a70fc
Commit
939a70fc
authored
Sep 12, 2024
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slap: default software type is now 'default'
See merge request
nexedi/slapos.core!677
parent
47784ddb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
slapos/proxy/views.py
slapos/proxy/views.py
+4
-3
slapos/slap/slap.py
slapos/slap/slap.py
+2
-1
slapos/util.py
slapos/util.py
+5
-5
No files found.
slapos/proxy/views.py
View file @
939a70fc
...
...
@@ -35,7 +35,8 @@ import re
import
os
from
datetime
import
datetime
from
slapos.slap.slap
import
Computer
,
ComputerPartition
,
\
SoftwareRelease
,
SoftwareInstance
,
NotFoundError
SoftwareRelease
,
SoftwareInstance
,
NotFoundError
,
\
DEFAULT_SOFTWARE_TYPE
,
OLD_DEFAULT_SOFTWARE_TYPE
from
slapos.proxy.db_version
import
DB_VERSION
import
slapos.slap
from
slapos.util
import
bytes2str
,
unicode2str
,
sqlite_connect
,
\
...
...
@@ -478,7 +479,7 @@ def requestComputerPartition():
'http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg'
,
)
if
parsed_request_dict
[
'software_release'
]
in
apache_frontend_sr_url_list
\
and
parsed_request_dict
.
get
(
'software_type'
,
''
)
in
(
''
,
'RootSoftwareInstance'
,
'default'
):
and
parsed_request_dict
.
get
(
'software_type'
,
''
)
in
(
''
,
OLD_DEFAULT_SOFTWARE_TYPE
,
DEFAULT_SOFTWARE_TYPE
):
url
=
parsed_request_dict
[
'partition_parameter_kw'
].
get
(
'url'
)
if
url
:
app
.
logger
.
warning
(
"Bypassing frontend for %s => %s"
,
parsed_request_dict
,
url
)
...
...
@@ -795,7 +796,7 @@ def requestNotSlave(software_release, software_type, partition_reference, partit
q
+=
' ,requested_by=?'
a
(
partition_id
)
if
not
software_type
:
software_type
=
'RootSoftwareInstance'
software_type
=
DEFAULT_SOFTWARE_TYPE
else
:
if
partition
[
'requested_by'
]:
root_partition
=
getRootPartition
(
partition
[
'requested_by'
])
...
...
slapos/slap/slap.py
View file @
939a70fc
...
...
@@ -70,7 +70,8 @@ fallback_logger.setLevel(logging.INFO)
fallback_logger
.
addHandler
(
fallback_handler
)
DEFAULT_SOFTWARE_TYPE
=
'RootSoftwareInstance'
OLD_DEFAULT_SOFTWARE_TYPE
=
'RootSoftwareInstance'
DEFAULT_SOFTWARE_TYPE
=
'default'
COMPUTER_PARTITION_REQUEST_LIST_TEMPLATE_FILENAME
=
'.slapos-request-transaction-%s'
class
SlapDocument
:
...
...
slapos/util.py
View file @
939a70fc
...
...
@@ -487,12 +487,12 @@ class SoftwareReleaseSchema(object):
def
__init__
(
self
,
software_url
,
software_type
):
# type: (str, Optional[str]) -> None
self
.
software_url
=
software_url
# XXX: Transition from DEFAULT_SOFTWARE_TYPE ("RootSoftwareInstance")
# to
"default"
is already complete for SR schemas.
from
slapos.slap.slap
import
DEFAULT_SOFTWARE_TYPE
if
software_type
==
DEFAULT_SOFTWARE_TYPE
:
# XXX: Transition from
OLD_
DEFAULT_SOFTWARE_TYPE ("RootSoftwareInstance")
# to
DEFAULT_SOFTWARE_TYPE ("default")
is already complete for SR schemas.
from
slapos.slap.slap
import
OLD_DEFAULT_SOFTWARE_TYPE
,
DEFAULT_SOFTWARE_TYPE
if
software_type
==
OLD_
DEFAULT_SOFTWARE_TYPE
:
software_type
=
None
self
.
software_type
=
software_type
or
'default'
self
.
software_type
=
software_type
or
DEFAULT_SOFTWARE_TYPE
def
_warn
(
self
,
message
,
e
):
warnings
.
warn
(
...
...
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