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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.core
Commits
73e009e5
Commit
73e009e5
authored
Aug 20, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow simplification.
parent
23552c1a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
51 deletions
+41
-51
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_promise/Alarm_checkPromiseVifibPAS.xml
...portal_skins/vifib_promise/Alarm_checkPromiseVifibPAS.xml
+40
-50
master/bt5/vifib_upgrader/bt/revision
master/bt5/vifib_upgrader/bt/revision
+1
-1
No files found.
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_promise/Alarm_checkPromiseVifibPAS.xml
View file @
73e009e5
...
@@ -54,68 +54,58 @@
...
@@ -54,68 +54,58 @@
\n
\n
portal = context.getPortalObject()\n
portal = context.getPortalObject()\n
\n
\n
def getPASDictDifference(portal, d):\n
def mergePASDictDifference(portal, d, fixit):\n
plugins = portal.acl_users.plugins\n
error_list = []\n
error_list = []\n
pas_list = portal.acl_users.objectValues()\n
plugin_type_info = plugins.listPluginTypeInfo()\n
pas_meta_type_set = set([q.meta_type for q in pas_list])\n
for plugin, active_list in d.iteritems():\n
for meta_type, plugin_list in d.iteritems():\n
plugin_info = [q for q in plugin_type_info if q[\'id\'] == plugin][0]\n
if meta_type not in pas_meta_type_set:\n
found_list = plugins.listPlugins(plugin_info[\'interface\'])\n
error_list.append(\'Missing plugin %r.\' % meta_type)\n
meta_type_list = [q[1].meta_type for q in found_list]\n
for expected in active_list:\n
if expected not in meta_type_list:\n
error = \'Plugin %s missing %s.\' % (plugin, expected)\n
if fixit: \n
existing = [q for q in portal.acl_users.objectValues() if q.meta_type == expected]\n
if len(existing) == 0:\n
error_list.append(\'%s not found\' % expected)\n
else:\n
else:\n
plugin = [q for q in pas_list if q.meta_type==meta_type][0]\n
plugins.activatePlugin(plugin_info[\'interface\'], existing[0].getId())\n
active_list = []\n
error += \' Fixed.\'\n
for plugin_type_info in plugin.plugins.listPluginTypeInfo():\n
error_list.append(error)\n
interface_name = plugin_type_info[\'id\']\n
\n
interface = plugin_type_info[\'interface\']\n
\n
if plugin.testImplements(interface):\n
if plugin.getId() in [q[0] for q in plugin.plugins.listPlugins(interface)]:\n
active_list.append(interface_name)\n
if plugin_list != active_list:\n
error_list.append(\'%r missing activation, expeced %s got %s.\' % (meta_type, \', \'.join(plugin_list), \', \'.join(active_list)))\n
return error_list\n
\n
\n
def mergePASDict(portal, s):\n
return error_list\n
raise NotImplementedError\n
\n
\n
promise_dict = {\n
promise_dict = {\n
\'Vifib Machine Authentication Plugin\': [\n
\'IExtractionPlugin\': [\n
\'IExtractionPlugin\',\n
\'Vifib Machine Authentication Plugin\',\n
\'IAuthenticationPlugin\',\n
\'Vifib Browser ID Extraction Plugin\',\n
\'IGroupsPlugin\',\n
\'Vifib Facebook Server Extraction Plugin\',\n
\'IUserEnumerationPlugin\'\n
\'Vifib Google Server Extraction Plugin\',\n
],\n
\'ERP5 Bearer Extraction Plugin\',\n
\'Vifib Shadow Authentication Plugin\': [\n
\'ERP5 Facebook Extraction Plugin\',\n
\'IAuthenticationPlugin\',\n
\'ERP5 Google Extraction Plugin\',\n
\'IGroupsPlugin\',\n
\'IUserEnumerationPlugin\'\n
],\n
\'Vifib Browser ID Extraction Plugin\': [\n
\'IExtractionPlugin\',\n
],\n
],\n
\'Vifib Facebook Server Extraction Plugin\': [\n
\'IAuthenticationPlugin\': [\n
\'IExtractionPlugin\',\n
\'Vifib Machine Authentication Plugin\',\n
\'Vifib Shadow Authentication Plugin\',\n
],\n
],\n
\'Vifib Google Server Extraction Plugin\': [\n
\'IGroupsPlugin\': [\n
\'IExtractionPlugin\',\n
\'Vifib Machine Authentication Plugin\',\n
\'Vifib Shadow Authentication Plugin\',\n
],\n
],\n
\'ERP5 Bearer Extraction Plugin\': [\n
\'IUserEnumerationPlugin\': [\n
\'IExtractionPlugin\',\n
\'Vifib Machine Authentication Plugin\',\n
],\n
\'Vifib Shadow Authentication Plugin\'\n
\'ERP5 Facebook Extraction Plugin\': [\n
\'IExtractionPlugin\',\n
],\n
\'ERP5 Google Extraction Plugin\': [\n
\'IExtractionPlugin\',\n
]\n
]\n
}\n
}\n
\n
pas_difference = mergePASDictDifference(portal, promise_dict, fixit)\n
pas_difference = getPASDictDifference(portal, promise_dict)\n
if len(pas_difference) != 0:\n
if len(pas_difference) != 0:\n
severity = 1\n
severity = 1\n
summary = "PAS not configured as expected"\n
summary = "PAS not configured as expected"\n
detail = "Difference %s" % (\'\\n\'.join(pas_difference), )\n
detail = "Difference:\\n%s" % (\'\\n\'.join(pas_difference), )\n
if fixit:\n
mergePASDict(portal, promise_dict)\n
else:\n
else:\n
severity = 0\n
severity = 0\n
summary = "Nothing to do."\n
summary = "Nothing to do."\n
...
...
master/bt5/vifib_upgrader/bt/revision
View file @
73e009e5
126
127
\ 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