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
18
Merge Requests
18
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
nexedi
slapos.core
Commits
63408dd1
Commit
63408dd1
authored
Aug 04, 2014
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Record software installation state with software instanllation reference
parent
501f6397
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 @
63408dd1
...
@@ -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
):
...
@@ -1318,6 +1325,19 @@ class SlapTool(BaseTool):
...
@@ -1318,6 +1325,19 @@ class SlapTool(BaseTool):
computer_document
.
getReference
(),
', '
.
join
([
q
.
getRelativeUrl
()
for
q
\
computer_document
.
getReference
(),
', '
.
join
([
q
.
getRelativeUrl
()
for
q
\
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
):
...
@@ -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