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
Boxiang Sun
slapos.core
Commits
89955c1a
Commit
89955c1a
authored
Mar 21, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/performance-hack'
parents
19f63616
a350e129
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
132 additions
and
12 deletions
+132
-12
master/bt5/vifib_erp5/PathTemplateItem/portal_caches/slap_cache_factory.xml
...rp5/PathTemplateItem/portal_caches/slap_cache_factory.xml
+74
-0
master/bt5/vifib_erp5/PathTemplateItem/portal_caches/slap_cache_factory/persistent_cache_plugin.xml
...tal_caches/slap_cache_factory/persistent_cache_plugin.xml
+36
-0
master/bt5/vifib_erp5/bt/template_path_list
master/bt5/vifib_erp5/bt/template_path_list
+2
-0
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+20
-12
No files found.
master/bt5/vifib_erp5/PathTemplateItem/portal_caches/slap_cache_factory.xml
0 → 100644
View file @
89955c1a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Cache Factory"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
cache_duration
</string>
</key>
<value>
<int>
10
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
slap_cache_factory
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Cache Factory
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Slap Cache Factory
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_erp5/PathTemplateItem/portal_caches/slap_cache_factory/persistent_cache_plugin.xml
0 → 100644
View file @
89955c1a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Distributed Ram Cache"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
specialise/portal_memcached/persistent_memcached_plugin
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
persistent_cache_plugin
</string>
</value>
</item>
<item>
<key>
<string>
int_index
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Distributed Ram Cache
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Persistent Distributed Ram Cache
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_erp5/bt/template_path_list
View file @
89955c1a
...
@@ -68,6 +68,8 @@ person_module/test_vifib_user_admin
...
@@ -68,6 +68,8 @@ person_module/test_vifib_user_admin
person_module/test_vifib_user_admin/**
person_module/test_vifib_user_admin/**
person_module/test_vifib_user_developer
person_module/test_vifib_user_developer
person_module/test_vifib_user_developer/**
person_module/test_vifib_user_developer/**
portal_caches/slap_cache_factory
portal_caches/slap_cache_factory/persistent_cache_plugin
service_module/computer_registration
service_module/computer_registration
service_module/computer_registration/**
service_module/computer_registration/**
service_module/vifib_discount
service_module/vifib_discount
...
...
master/product/Vifib/Tool/SlapTool.py
View file @
89955c1a
...
@@ -38,6 +38,7 @@ from Products.ERP5Type.Globals import InitializeClass
...
@@ -38,6 +38,7 @@ from Products.ERP5Type.Globals import InitializeClass
from
Products.ERP5Type.Tool.BaseTool
import
BaseTool
from
Products.ERP5Type.Tool.BaseTool
import
BaseTool
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
ComplexQuery
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
ComplexQuery
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.Cache
import
CachingMethod
from
lxml
import
etree
from
lxml
import
etree
try
:
try
:
from
slapos.slap.slap
import
Computer
from
slapos.slap.slap
import
Computer
...
@@ -140,19 +141,26 @@ class SlapTool(BaseTool):
...
@@ -140,19 +141,26 @@ class SlapTool(BaseTool):
Reuses slap library for easy marshalling.
Reuses slap library for easy marshalling.
"""
"""
self
.
REQUEST
.
response
.
setHeader
(
'Content-Type'
,
'text/xml'
)
slap_computer
=
Computer
(
computer_id
)
parent_uid
=
self
.
_getComputerUidByReference
(
computer_id
)
slap_computer
.
_computer_partition_list
=
[]
def
_getComputerInformation
(
computer_id
,
user
):
slap_computer
.
_software_release_list
=
\
self
.
REQUEST
.
response
.
setHeader
(
'Content-Type'
,
'text/xml'
)
self
.
_getSoftwareReleaseValueListForComputer
(
computer_id
)
slap_computer
=
Computer
(
computer_id
)
for
computer_partition
in
self
.
getPortalObject
().
portal_catalog
(
parent_uid
=
self
.
_getComputerUidByReference
(
computer_id
)
parent_uid
=
parent_uid
,
portal_type
=
"Computer Partition"
):
slap_computer
.
_computer_partition_list
=
[]
slap_computer
.
_computer_partition_list
.
append
(
slap_computer
.
_software_release_list
=
\
self
.
_getSlapPartitionByPackingList
(
computer_partition
.
getObject
()))
self
.
_getSoftwareReleaseValueListForComputer
(
computer_id
)
return
xml_marshaller
.
xml_marshaller
.
dumps
(
slap_computer
)
for
computer_partition
in
self
.
getPortalObject
().
portal_catalog
(
parent_uid
=
parent_uid
,
portal_type
=
"Computer Partition"
):
slap_computer
.
_computer_partition_list
.
append
(
self
.
_getSlapPartitionByPackingList
(
computer_partition
.
getObject
()))
return
xml_marshaller
.
xml_marshaller
.
dumps
(
slap_computer
)
user
=
self
.
getPortalObject
().
portal_membership
.
getAuthenticatedMember
().
getUserName
()
return
CachingMethod
(
_getComputerInformation
,
id
=
'_getComputerInformation'
,
cache_factory
=
'slap_cache_factory'
)(
computer_id
,
user
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getFullComputerInformation'
)
'getFullComputerInformation'
)
...
...
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