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
Łukasz Nowak
slapos.core
Commits
4feff2ad
Commit
4feff2ad
authored
Oct 31, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up computer cache calculation.
parent
b88dce16
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
210 additions
and
40 deletions
+210
-40
master/bt5/slapos_slap_tool/ExtensionTemplateItem/SlapOSSlapTool.py
.../slapos_slap_tool/ExtensionTemplateItem/SlapOSSlapTool.py
+37
-0
master/bt5/slapos_slap_tool/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
...rtalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
+18
-0
master/bt5/slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool_interaction_workflow.xml
...portal_workflow/slapos_slap_tool_interaction_workflow.xml
+46
-0
master/bt5/slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool_interaction_workflow/interactions.xml
...ow/slapos_slap_tool_interaction_workflow/interactions.xml
+28
-0
master/bt5/slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool_interaction_workflow/interactions/Item_reindexObject.xml
..._interaction_workflow/interactions/Item_reindexObject.xml
+0
-0
master/bt5/slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool_interaction_workflow/scripts.xml
...orkflow/slapos_slap_tool_interaction_workflow/scripts.xml
+28
-0
master/bt5/slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool_interaction_workflow/scripts/Item_activateFillComputerInformationCache.xml
...low/scripts/Item_activateFillComputerInformationCache.xml
+1
-1
master/bt5/slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool_interaction_workflow/variables.xml
...kflow/slapos_slap_tool_interaction_workflow/variables.xml
+22
-0
master/bt5/slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool_interaction_workflow/worklists.xml
...kflow/slapos_slap_tool_interaction_workflow/worklists.xml
+22
-0
master/bt5/slapos_slap_tool/bt/revision
master/bt5/slapos_slap_tool/bt/revision
+1
-1
master/bt5/slapos_slap_tool/bt/template_extension_id_list
master/bt5/slapos_slap_tool/bt/template_extension_id_list
+1
-0
master/bt5/slapos_slap_tool/bt/template_portal_type_workflow_chain_list
...pos_slap_tool/bt/template_portal_type_workflow_chain_list
+4
-0
master/bt5/slapos_slap_tool/bt/template_workflow_id_list
master/bt5/slapos_slap_tool/bt/template_workflow_id_list
+1
-0
master/bt5/vifib_slap/ExtensionTemplateItem/VifibUtil.py
master/bt5/vifib_slap/ExtensionTemplateItem/VifibUtil.py
+0
-37
master/bt5/vifib_slap/bt/revision
master/bt5/vifib_slap/bt/revision
+1
-1
No files found.
master/bt5/slapos_slap_tool/ExtensionTemplateItem/SlapOSSlapTool.py
0 → 100644
View file @
4feff2ad
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
AccessControl.SecurityManagement
import
getSecurityManager
,
\
setSecurityManager
,
newSecurityManager
@
UnrestrictedMethod
def
getComputerReference
(
item
):
portal_type
=
item
.
getPortalType
()
computer
=
None
if
portal_type
==
'Software Installation'
:
computer
=
item
.
getAggregateValue
(
portal_type
=
'Computer'
)
elif
portal_type
==
'Computer Partition'
:
computer
=
item
.
getParentValue
()
elif
portal_type
in
[
'Software Instance'
,
'Slave Instance'
]:
partition
=
item
.
getAggregateValue
(
portal_type
=
'Computer Partition'
)
if
partition
is
not
None
:
computer
=
partition
.
getParentValue
()
if
computer
is
not
None
and
computer
.
getValidationState
()
==
'validated'
:
return
computer
.
getReference
()
return
None
def
Item_activateFillComputerInformationCache
(
state_change
):
item
=
state_change
[
'object'
]
portal
=
item
.
getPortalObject
()
computer_reference
=
getComputerReference
(
item
)
if
computer_reference
is
None
:
return
None
sm
=
getSecurityManager
()
try
:
newSecurityManager
(
None
,
portal
.
acl_users
.
getUserById
(
computer_reference
))
portal
.
portal_slap
.
_activateFillComputerInformationCache
(
computer_reference
,
computer_reference
)
finally
:
setSecurityManager
(
sm
)
master/bt5/slapos_slap_tool/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
0 → 100644
View file @
4feff2ad
<workflow_chain>
<chain>
<type>
Computer Partition
</type>
<workflow>
slapos_slap_tool_interaction_workflow
</workflow>
</chain>
<chain>
<type>
Slave Instance
</type>
<workflow>
slapos_slap_tool_interaction_workflow
</workflow>
</chain>
<chain>
<type>
Software Installation
</type>
<workflow>
slapos_slap_tool_interaction_workflow
</workflow>
</chain>
<chain>
<type>
Software Instance
</type>
<workflow>
slapos_slap_tool_interaction_workflow
</workflow>
</chain>
</workflow_chain>
\ No newline at end of file
master/bt5/slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool_interaction_workflow.xml
0 → 100644
View file @
4feff2ad
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"InteractionWorkflowDefinition"
module=
"Products.ERP5.InteractionWorkflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
creation_guard
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
groups
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
slapos_slap_tool_interaction_workflow
</string>
</value>
</item>
<item>
<key>
<string>
manager_bypass
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
SlapOS Slap Tool Interaction Workflow
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool_interaction_workflow/interactions.xml
0 → 100644
View file @
4feff2ad
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interaction"
module=
"Products.ERP5.Interaction"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_mapping
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interactions
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/
vifib_slap/WorkflowTemplateItem/portal_workflow/slap
_interaction_workflow/interactions/Item_reindexObject.xml
→
master/bt5/
slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool
_interaction_workflow/interactions/Item_reindexObject.xml
View file @
4feff2ad
File moved
master/bt5/slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool_interaction_workflow/scripts.xml
0 → 100644
View file @
4feff2ad
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Scripts"
module=
"Products.DCWorkflow.Scripts"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_mapping
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
scripts
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/
vifib_slap/WorkflowTemplateItem/portal_workflow/slap
_interaction_workflow/scripts/Item_activateFillComputerInformationCache.xml
→
master/bt5/
slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool
_interaction_workflow/scripts/Item_activateFillComputerInformationCache.xml
View file @
4feff2ad
...
...
@@ -12,7 +12,7 @@
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
VifibUti
l
</string>
</value>
<value>
<string>
SlapOSSlapToo
l
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
master/bt5/slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool_interaction_workflow/variables.xml
0 → 100644
View file @
4feff2ad
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Variables"
module=
"Products.DCWorkflow.Variables"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_mapping
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
variables
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_slap_tool/WorkflowTemplateItem/portal_workflow/slapos_slap_tool_interaction_workflow/worklists.xml
0 → 100644
View file @
4feff2ad
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Worklists"
module=
"Products.DCWorkflow.Worklists"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_mapping
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
worklists
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_slap_tool/bt/revision
View file @
4feff2ad
9
\ No newline at end of file
10
\ No newline at end of file
master/bt5/slapos_slap_tool/bt/template_extension_id_list
0 → 100644
View file @
4feff2ad
SlapOSSlapTool
\ No newline at end of file
master/bt5/slapos_slap_tool/bt/template_portal_type_workflow_chain_list
0 → 100644
View file @
4feff2ad
Computer Partition | slapos_slap_tool_interaction_workflow
Slave Instance | slapos_slap_tool_interaction_workflow
Software Installation | slapos_slap_tool_interaction_workflow
Software Instance | slapos_slap_tool_interaction_workflow
\ No newline at end of file
master/bt5/slapos_slap_tool/bt/template_workflow_id_list
0 → 100644
View file @
4feff2ad
slapos_slap_tool_interaction_workflow
\ No newline at end of file
master/bt5/vifib_slap/ExtensionTemplateItem/VifibUtil.py
View file @
4feff2ad
import
hashlib
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
AccessControl.SecurityManagement
import
getSecurityManager
,
\
setSecurityManager
,
newSecurityManager
def
getSha512Hexdiest
(
s
):
return
hashlib
.
sha512
(
s
).
hexdigest
()
@
UnrestrictedMethod
def
getComputerReference
(
item
):
portal_type
=
item
.
getPortalType
()
computer
=
None
if
portal_type
==
'Software Installation'
:
computer
=
item
.
getAggregateValue
(
portal_type
=
'Computer'
)
elif
portal_type
==
'Computer Partition'
:
computer
=
item
.
getParentValue
()
elif
portal_type
in
[
'Software Instance'
,
'Slave Instance'
]:
partition
=
item
.
getAggregateValue
(
portal_type
=
'Computer Partition'
)
if
partition
is
not
None
:
computer
=
partition
.
getParentValue
()
if
computer
is
not
None
and
computer
.
getValidationState
()
==
'validated'
:
return
computer
.
getReference
()
return
None
def
Item_activateFillComputerInformationCache
(
state_change
):
item
=
state_change
[
'object'
]
portal
=
item
.
getPortalObject
()
computer_reference
=
getComputerReference
(
item
)
if
computer_reference
is
None
:
return
None
sm
=
getSecurityManager
()
try
:
newSecurityManager
(
None
,
portal
.
acl_users
.
getUserById
(
computer_reference
))
portal
.
portal_slap
.
_activateFillComputerInformationCache
(
computer_reference
,
computer_reference
)
finally
:
setSecurityManager
(
sm
)
master/bt5/vifib_slap/bt/revision
View file @
4feff2ad
865
\ No newline at end of file
866
\ No newline at end of file
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