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
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
Show 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):
...
@@ -886,21 +886,28 @@ class SlapTool(BaseTool):
@
convertToREST
@
convertToREST
def
_buildingSoftwareRelease
(
self
,
url
,
computer_id
):
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
.
\
user
=
self
.
getPortalObject
().
portal_membership
.
\
getAuthenticatedMember
().
getUserName
()
getAuthenticatedMember
().
getUserName
()
self
.
_logAccess
(
user
,
user
,
'building software release %s'
%
url
)
self
.
_logAccess
(
user
,
software_installation_reference
,
'building software release %s'
%
url
)
@
convertToREST
@
convertToREST
def
_availableSoftwareRelease
(
self
,
url
,
computer_id
):
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
.
\
user
=
self
.
getPortalObject
().
portal_membership
.
\
getAuthenticatedMember
().
getUserName
()
getAuthenticatedMember
().
getUserName
()
self
.
_logAccess
(
user
,
user
,
'#access software release %s available'
%
\
self
.
_logAccess
(
user
,
software_installation_reference
,
url
)
'#access software release %s available'
%
url
)
@
convertToREST
@
convertToREST
def
_destroyedSoftwareRelease
(
self
,
url
,
computer_id
):
def
_destroyedSoftwareRelease
(
self
,
url
,
computer_id
):
...
@@ -1319,6 +1326,19 @@ class SlapTool(BaseTool):
...
@@ -1319,6 +1326,19 @@ class SlapTool(BaseTool):
in
software_installation_list
])
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
,
def
_getSoftwareInstanceForComputerPartition
(
self
,
computer_id
,
computer_partition_id
,
slave_reference
=
None
):
computer_partition_id
,
slave_reference
=
None
):
computer_partition_document
=
self
.
_getComputerPartitionDocument
(
computer_partition_document
=
self
.
_getComputerPartitionDocument
(
...
@@ -1433,9 +1453,12 @@ class SlapTool(BaseTool):
...
@@ -1433,9 +1453,12 @@ class SlapTool(BaseTool):
"""
"""
Log the computer status
Log the computer status
"""
"""
user
=
self
.
getPortalObject
().
portal_membership
.
getAuthenticatedMember
()
\
computer_document
=
self
.
_getComputerDocument
(
computer_id
)
.
getUserName
()
software_installation_reference
=
self
.
_getCachedSoftwareInstallationReference
(
url
,
self
.
_logAccess
(
computer_document
)
user
,
computer_id
,
'#error while installing %s'
%
url
)
user
=
self
.
getPortalObject
().
portal_membership
.
\
getAuthenticatedMember
().
getUserName
()
self
.
_logAccess
(
user
,
software_installation_reference
,
'#error while installing %s'
%
url
)
InitializeClass
(
SlapTool
)
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