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
Lisa Casino
slapos.core
Commits
71224c30
Commit
71224c30
authored
Dec 20, 2012
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
symlink to software_release in each partition
parent
5b3837e7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
CHANGES.txt
CHANGES.txt
+1
-0
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+14
-1
No files found.
CHANGES.txt
View file @
71224c30
...
...
@@ -7,6 +7,7 @@ Changes
* slapproxy: Filter by instance_guid, allow computer partition renames
and change of software_type and requested_state [Marco Mariani]
* slapproxy: Stop instance even if buildout/reporting is wrong [Cedric de Saint Martin]
* symlink to software_release in each partition [Marco Mariani]
0.33.1 (2012-11-05)
-------------------
...
...
slapos/grid/SlapObject.py
View file @
71224c30
...
...
@@ -205,7 +205,7 @@ class Software(object):
if
func
==
os
.
path
.
islink
:
os
.
unlink
(
path
)
else
:
os
.
chmod
(
path
,
0600
)
os
.
chmod
(
path
,
0600
)
func
(
path
)
try
:
if
os
.
path
.
exists
(
self
.
software_path
):
...
...
@@ -304,6 +304,15 @@ class Partition(object):
USER
=
pwd
.
getpwuid
(
uid
).
pw_name
,
)
def
updateSymlink
(
self
,
sr_symlink
,
software_path
):
if
os
.
path
.
exists
(
sr_symlink
):
if
not
os
.
path
.
islink
(
sr_symlink
):
self
.
logger
.
debug
(
'Not a symlink: %s, has been ignored'
%
(
sr_symlink
))
return
os
.
unlink
(
sr_symlink
)
os
.
symlink
(
software_path
,
sr_symlink
)
os
.
lchown
(
sr_symlink
,
*
self
.
getUserGroupId
())
def
install
(
self
):
""" Creates configuration file from template in software_path, then
installs the software partition with the help of buildout
...
...
@@ -315,6 +324,10 @@ class Partition(object):
if
not
os
.
path
.
isdir
(
self
.
instance_path
):
raise
PathDoesNotExistError
(
'Please create partition directory %s'
%
self
.
instance_path
)
sr_symlink
=
os
.
path
.
join
(
self
.
instance_path
,
'software_release'
)
self
.
updateSymlink
(
sr_symlink
,
self
.
software_path
)
instance_stat_info
=
os
.
stat
(
self
.
instance_path
)
permission
=
oct
(
stat
.
S_IMODE
(
instance_stat_info
.
st_mode
))
if
permission
!=
REQUIRED_COMPUTER_PARTITION_PERMISSION
:
...
...
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