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
Thomas Leymonerie
slapos.core
Commits
47bd2ede
Commit
47bd2ede
authored
Sep 21, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change module ID generator in promise.
Also use this code in test.
parent
f62806da
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
273 additions
and
7 deletions
+273
-7
master/bt5/vifib_upgrader/PathTemplateItem/portal_alarms/vifib_promise_module_id_generator.xml
...eItem/portal_alarms/vifib_promise_module_id_generator.xml
+105
-0
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_promise/Alarm_checkPromiseVifibModuleIdGenerator.xml
...ifib_promise/Alarm_checkPromiseVifibModuleIdGenerator.xml
+97
-0
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_promise/Alarm_fixPromiseVifibModuleIdGenerator.xml
.../vifib_promise/Alarm_fixPromiseVifibModuleIdGenerator.xml
+67
-0
master/bt5/vifib_upgrader/bt/revision
master/bt5/vifib_upgrader/bt/revision
+1
-1
master/bt5/vifib_upgrader/bt/template_path_list
master/bt5/vifib_upgrader/bt/template_path_list
+1
-0
master/product/Vifib/tests/VifibMixin.py
master/product/Vifib/tests/VifibMixin.py
+2
-6
No files found.
master/bt5/vifib_upgrader/PathTemplateItem/portal_alarms/vifib_promise_module_id_generator.xml
0 → 100644
View file @
47bd2ede
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Alarm"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_checkPromiseVifibModuleIdGenerator
</string>
</value>
</item>
<item>
<key>
<string>
alarm_notification_mode
</string>
</key>
<value>
<tuple>
<string>
never
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
vifib_promise_module_id_generator
</string>
</value>
</item>
<item>
<key>
<string>
periodicity_day_frequency
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<value>
<tuple>
<int>
0
</int>
</tuple>
</value>
</item>
<item>
<key>
<string>
periodicity_minute
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_start_date
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
0.0
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
periodicity_week
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Alarm
</string>
</value>
</item>
<item>
<key>
<string>
solve_method_id
</string>
</key>
<value>
<string>
Alarm_fixPromiseVifibPAS
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Module Id Generator Vifib Promise
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_promise/Alarm_checkPromiseVifibModuleIdGenerator.xml
0 → 100644
View file @
47bd2ede
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.CMFActivity.ActiveResult import ActiveResult\n
\n
portal = context.getPortalObject()\n
wrong_module_list = []\n
for module_id in portal.objectIds(spec=(\'ERP5 Folder\',)) + ["portal_simulation", "portal_activities"]:\n
module = portal.restrictedTraverse(module_id)\n
if module.getIdGenerator() != \'_generatePerDayId\':\n
wrong_module_list.append(module.getRelativeUrl())\n
if fixit:\n
module.setIdGenerator(\'_generatePerDayId\')\n
\n
if len(wrong_module_list) != 0:\n
summary = "Some modules have incorrect ID generator"\n
if fixit:\n
summary += ", fixed."\n
severity = 0\n
else:\n
severity = 1\n
detail = "List: %s" % (\', \'.join(wrong_module_list), )\n
else:\n
severity = 0\n
summary = "Nothing to do."\n
detail = ""\n
\n
active_result = ActiveResult()\n
active_result.edit(\n
summary=summary, \n
severity=severity,\n
detail=detail)\n
\n
context.newActiveProcess().postResult(active_result)\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
tag, fixit=False, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_checkPromiseVifibModuleIdGenerator
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_promise/Alarm_fixPromiseVifibModuleIdGenerator.xml
0 → 100644
View file @
47bd2ede
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
context.activeSense(fixit=1)\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_fixPromiseVifibModuleIdGenerator
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_upgrader/bt/revision
View file @
47bd2ede
137
\ No newline at end of file
138
\ No newline at end of file
master/bt5/vifib_upgrader/bt/template_path_list
View file @
47bd2ede
portal_alarms/vifib_promise_module_id_generator
portal_alarms/vifib_promise_pas
\ No newline at end of file
master/product/Vifib/tests/VifibMixin.py
View file @
47bd2ede
...
...
@@ -308,14 +308,10 @@ class testVifibMixin(ERP5TypeTestCase):
self
.
clearCache
()
# Change module ID generator
for
module_id
in
portal
.
objectIds
(
spec
=
(
'ERP5 Folder'
,))
+
\
[
"portal_simulation"
,
"portal_activities"
]:
module
=
portal
.
restrictedTraverse
(
module_id
)
module
.
setIdGenerator
(
'_generatePerDayId'
)
self
.
logMessage
(
"Bootstrap Vifib Without Security..."
)
self
.
login
()
# Change module ID generator
self
.
portal
.
portal_alarms
.
vifib_promise_module_id_generator
.
solve
()
# setup Vifib PAS
self
.
portal
.
portal_alarms
.
vifib_promise_pas
.
solve
()
self
.
prepareTestUsers
()
...
...
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