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
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
Jérome Perrin
slapos.core
Commits
88bd0cb3
Commit
88bd0cb3
authored
Sep 02, 2021
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapgrid: Map instances to their installed python
parent
f3699528
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+15
-0
No files found.
slapos/grid/SlapObject.py
View file @
88bd0cb3
...
...
@@ -472,6 +472,8 @@ class Partition(object):
self
.
instance_min_free_space
=
instance_min_free_space
self
.
instance_python
=
self
.
getInstalledPythonExecutable
()
def
check_free_space
(
self
):
required
=
self
.
instance_min_free_space
or
0
...
...
@@ -705,6 +707,7 @@ class Partition(object):
debug
=
self
.
buildout_debug
)
self
.
generateSupervisorConfigurationFile
()
self
.
createRetentionLockDelay
()
self
.
instance_python
=
self
.
getInstalledPythonExecutable
()
def
generateSupervisorConfiguration
(
self
):
"""
...
...
@@ -1043,3 +1046,15 @@ class Partition(object):
return
float
(
date_file_path
.
read
())
else
:
return
None
def
getInstalledPythonExecutable
(
self
):
"""
Return the path of the python executable installed for the SR of this instance.
"""
try
:
with
open
(
os
.
path
.
join
(
self
.
software_path
,
'bin'
,
'buildout'
))
as
f
:
shebang
=
f
.
readline
()
except
OSError
:
return
if
shebang
.
startswith
(
'#!'
):
return
shebang
[
2
:].
split
(
None
,
1
)[
0
]
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