Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
amrani
erp5
Commits
f0dfc4c9
Commit
f0dfc4c9
authored
Sep 12, 2011
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor code to validate if the persistent memcache plugin is working
parent
e4b0603f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_verifyMemcachedIntegrity.xml
...skins/erp5_upgrader/ERP5Site_verifyMemcachedIntegrity.xml
+14
-10
bt5/erp5_upgrader/bt/revision
bt5/erp5_upgrader/bt/revision
+1
-1
No files found.
bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_verifyMemcachedIntegrity.xml
View file @
f0dfc4c9
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
Verify if this instance is a properly configured one.\n
Verify if this instance is a properly configured one.\n
This script could be used in functional tests\n
This script could be used in functional tests\n
"""\n
"""\n
plugin_id_list = [\'default_memcached_plugin\',\'persistent_memcached_plugin\'
]\n
plugin_id_list = [\'default_memcached_plugin\',\'persistent_memcached_plugin\']\n
portal = context.getPortalObject()\n
portal = context.getPortalObject()\n
key_prefix = \'upgrade_verification\'\n
key_prefix = \'upgrade_verification\'\n
if getattr(portal, "erp5_site_global_id", None) == "test_client_chroot":\n
if getattr(portal, "erp5_site_global_id", None) == "test_client_chroot":\n
...
@@ -73,7 +73,7 @@ def assertNotEquals(value1, value2, label=""):\n
...
@@ -73,7 +73,7 @@ def assertNotEquals(value1, value2, label=""):\n
message_list.append("Memcached: %s Fail (%s == %s)" % (label, value1, value2))\n
message_list.append("Memcached: %s Fail (%s == %s)" % (label, value1, value2))\n
\n
\n
# Verify if memcached and plugins are present into the instance\n
# Verify if memcached and plugins are present into the instance\n
portal_memcached = getattr(
context.getPortalObject()
, "portal_memcached", None)\n
portal_memcached = getattr(
portal
, "portal_memcached", None)\n
if portal_memcached is not None:\n
if portal_memcached is not None:\n
plugin_object_id_list = portal_memcached.objectIds()\n
plugin_object_id_list = portal_memcached.objectIds()\n
for plugin_id in plugin_id_list:\n
for plugin_id in plugin_id_list:\n
...
@@ -83,18 +83,22 @@ else: \n
...
@@ -83,18 +83,22 @@ else: \n
message_list.append("Portal Memcached is not present.")\n
message_list.append("Portal Memcached is not present.")\n
\n
\n
# Test Plugins\n
# Test Plugins\n
def getMemcachedDict():\n
def getMemcachedDict(
plugin_path
):\n
return portal_memcached.getMemcachedDict(key_prefix=key_prefix, \n
return portal_memcached.getMemcachedDict(key_prefix=key_prefix, \n
plugin_path=
\'portal_memcached/default_memcached_plugin\'
)\n
plugin_path=
plugin_path
)\n
\n
\n
# If this is not None the value was get from another instance\n
# If this is not None the value was get from another instance\n
site_id = getattr(portal, "erp5_site_global_id", None)\n
site_id = getattr(portal, "erp5_site_global_id", None)\n
if getMemcachedDict().get("upgrade_verification_key", site_id) == "Foo Bar":\n
for plugin_id in plugin_id_list:\n
plugin_object = getMemcachedDict(\'portal_memcached/%s\' % plugin_id)\n
if plugin_object.get("upgrade_verification_key") in ("Foo Bar", None):\n
# Solve some possible legacy.\n
# Solve some possible legacy.\n
getMemcachedDict().set("upgrade_verification_key", site_id)\n
plugin_object["upgrade_verification_key"] = site_id\n
assertEquals(getMemcachedDict().get("upgrade_verification_key", site_id), site_id, "upgrade_verification_key")\n
assertEquals(plugin_object.get("upgrade_verification_key", site_id),\n
getMemcachedDict().set("upgrade_verification_key", site_id)\n
site_id, "upgrade_verification_key")\n
assertEquals(getMemcachedDict().get("upgrade_verification_key", None), site_id, "upgrade_verification_key")\n
plugin_object.set("upgrade_verification_key", site_id)\n
assertEquals(plugin_object.get("upgrade_verification_key", None),\n
site_id, "upgrade_verification_key")\n
\n
\n
return message_list\n
return message_list\n
</string>
</value>
</string>
</value>
...
...
bt5/erp5_upgrader/bt/revision
View file @
f0dfc4c9
590
591
\ No newline at end of file
\ 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