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
d479f1bb
Commit
d479f1bb
authored
Aug 04, 2014
by
Alain Takoudjou
Committed by
Rafael Monnerat
Aug 05, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Record software installation state with software instanllation reference
parent
f3e287bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
9 deletions
+32
-9
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+32
-9
No files found.
master/product/Vifib/Tool/SlapTool.py
View file @
d479f1bb
...
...
@@ -886,21 +886,28 @@ class SlapTool(BaseTool):
@
convertToREST
def
_buildingSoftwareRelease
(
self
,
url
,
computer_id
):
"""
Log the
computer
status
Log the
software release
status
"""
computer_document
=
self
.
_getComputerDocument
(
computer_id
)
software_installation_reference
=
self
.
_getCachedSoftwareInstallationReference
(
url
,
computer_document
)
user
=
self
.
getPortalObject
().
portal_membership
.
\
getAuthenticatedMember
().
getUserName
()
self
.
_logAccess
(
user
,
user
,
'building software release %s'
%
url
)
self
.
_logAccess
(
user
,
software_installation_reference
,
'building software release %s'
%
url
)
@
convertToREST
def
_availableSoftwareRelease
(
self
,
url
,
computer_id
):
"""
Log the
computer
status
Log the
software release
status
"""
computer_document
=
self
.
_getComputerDocument
(
computer_id
)
software_installation_reference
=
self
.
_getCachedSoftwareInstallationReference
(
url
,
computer_document
)
user
=
self
.
getPortalObject
().
portal_membership
.
\
getAuthenticatedMember
().
getUserName
()
self
.
_logAccess
(
user
,
user
,
'#access software release %s available'
%
\
url
)
self
.
_logAccess
(
user
,
software_installation_reference
,
'#access software release %s available'
%
url
)
@
convertToREST
def
_destroyedSoftwareRelease
(
self
,
url
,
computer_id
):
...
...
@@ -1318,6 +1325,19 @@ class SlapTool(BaseTool):
computer_document
.
getReference
(),
', '
.
join
([
q
.
getRelativeUrl
()
for
q
\
in
software_installation_list
])
))
def
_getNonCachedSoftwareInstallationReference
(
self
,
url
,
computer_document
):
return
self
.
_getSoftwareInstallationForComputer
(
url
,
computer_document
).
getReference
()
def
_getCachedSoftwareInstallationReference
(
self
,
url
,
computer_document
):
"""
Get the software installation reference (with this url) for the computer.
"""
result
=
CachingMethod
(
self
.
_getNonCachedSoftwareInstallationReference
,
id
=
'_getCachedSoftwareInstallationReference'
,
cache_factory
=
'slap_cache_factory'
)(
url
,
computer_document
)
return
result
def
_getSoftwareInstanceForComputerPartition
(
self
,
computer_id
,
computer_partition_id
,
slave_reference
=
None
):
...
...
@@ -1433,9 +1453,12 @@ class SlapTool(BaseTool):
"""
Log the computer status
"""
user
=
self
.
getPortalObject
().
portal_membership
.
getAuthenticatedMember
()
\
.
getUserName
()
self
.
_logAccess
(
user
,
computer_id
,
'#error while installing %s'
%
url
)
computer_document
=
self
.
_getComputerDocument
(
computer_id
)
software_installation_reference
=
self
.
_getCachedSoftwareInstallationReference
(
url
,
computer_document
)
user
=
self
.
getPortalObject
().
portal_membership
.
\
getAuthenticatedMember
().
getUserName
()
self
.
_logAccess
(
user
,
software_installation_reference
,
'#error while installing %s'
%
url
)
InitializeClass
(
SlapTool
)
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