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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
6684c59f
Commit
6684c59f
authored
Apr 11, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cache migrated to new bt format
parent
f449cb6c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
96 deletions
+87
-96
master/bt5/slapos_cache/SkinTemplateItem/portal_skins/slapos_cache/Alarm_checkPromiseShacacheWebSite.py
...l_skins/slapos_cache/Alarm_checkPromiseShacacheWebSite.py
+50
-0
master/bt5/slapos_cache/SkinTemplateItem/portal_skins/slapos_cache/Alarm_checkPromiseShacacheWebSite.xml
..._skins/slapos_cache/Alarm_checkPromiseShacacheWebSite.xml
+0
-54
master/bt5/slapos_cache/SkinTemplateItem/portal_skins/slapos_cache/Alarm_installShacacheWebSite.py
...portal_skins/slapos_cache/Alarm_installShacacheWebSite.py
+36
-0
master/bt5/slapos_cache/SkinTemplateItem/portal_skins/slapos_cache/Alarm_installShacacheWebSite.xml
...ortal_skins/slapos_cache/Alarm_installShacacheWebSite.xml
+0
-40
master/bt5/slapos_cache/SkinTemplateItem/portal_skins/slapos_cache/SystemPreference_viewShacache.xml
...rtal_skins/slapos_cache/SystemPreference_viewShacache.xml
+1
-1
master/bt5/slapos_cache/bt/revision
master/bt5/slapos_cache/bt/revision
+0
-1
No files found.
master/bt5/slapos_cache/SkinTemplateItem/portal_skins/slapos_cache/Alarm_checkPromiseShacacheWebSite.py
0 → 100644
View file @
6684c59f
from
Products.CMFActivity.ActiveResult
import
ActiveResult
portal
=
context
.
getPortalObject
()
web_site_module
=
getattr
(
portal
,
'web_site_module'
,
None
)
if
web_site_module
is
None
:
# web_site_module is not present yet, so it is impossible
# to keep the promise
return
False
shacache
=
getattr
(
web_site_module
,
'shacache'
,
None
)
shadir
=
getattr
(
web_site_module
,
'shadir'
,
None
)
expected_state
=
context
.
portal_preferences
.
getPreferredShacacheWebsiteExpectedState
(
"published"
)
active_result
=
ActiveResult
()
if
expected_state
==
"published"
and
shacache
is
None
:
severity
=
1
summary
=
"Shacache WebSite do not exist"
detail
=
""
elif
expected_state
==
"published"
and
shadir
is
None
:
severity
=
1
summary
=
"Shadir WebSite do not exist"
detail
=
""
elif
expected_state
==
"published"
and
shacache
.
getSkinSelectionName
()
!=
"SHACACHE"
:
severity
=
1
summary
=
"shacache site don't have SHACACHE as skin selection name"
detail
=
""
elif
expected_state
==
"published"
and
shadir
.
getSkinSelectionName
()
!=
"SHADIR"
:
severity
=
1
summary
=
"shadir site don't have SHADIR as skin selection name"
detail
=
""
elif
shacache
is
not
None
and
shacache
.
getValidationState
()
!=
expected_state
:
severity
=
1
summary
=
"shacache site is not what is expected: %s"
%
expected_state
detail
=
""
elif
shadir
is
not
None
and
shadir
.
getValidationState
()
!=
expected_state
:
severity
=
1
summary
=
"shadir site is not published %s"
%
expected_state
detail
=
""
else
:
severity
=
0
summary
=
"Nothing to do."
detail
=
""
active_result
.
edit
(
summary
=
summary
,
severity
=
severity
,
detail
=
detail
)
context
.
newActiveProcess
().
postResult
(
active_result
)
master/bt5/slapos_cache/SkinTemplateItem/portal_skins/slapos_cache/Alarm_checkPromiseShacacheWebSite.xml
View file @
6684c59f
...
...
@@ -48,60 +48,6 @@
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.CMFActivity.ActiveResult import ActiveResult\n
\n
portal = context.getPortalObject()\n
web_site_module = getattr(portal, \'web_site_module\', None)\n
if web_site_module is None:\n
# web_site_module is not present yet, so it is impossible\n
# to keep the promise\n
return False\n
\n
shacache = getattr(web_site_module, \'shacache\', None)\n
shadir = getattr(web_site_module, \'shadir\', None)\n
\n
expected_state = context.portal_preferences.getPreferredShacacheWebsiteExpectedState("published")\n
\n
active_result = ActiveResult()\n
if expected_state == "published" and shacache is None:\n
severity = 1\n
summary = "Shacache WebSite do not exist"\n
detail = ""\n
elif expected_state == "published" and shadir is None:\n
severity = 1\n
summary = "Shadir WebSite do not exist"\n
detail = ""\n
elif expected_state == "published" and shacache.getSkinSelectionName() != "SHACACHE":\n
severity = 1\n
summary = "shacache site don\'t have SHACACHE as skin selection name"\n
detail = ""\n
elif expected_state == "published" and shadir.getSkinSelectionName() != "SHADIR":\n
severity = 1\n
summary = "shadir site don\'t have SHADIR as skin selection name"\n
detail = ""\n
elif shacache is not None and shacache.getValidationState() != expected_state:\n
severity = 1\n
summary = "shacache site is not what is expected: %s" % expected_state\n
detail = ""\n
elif shadir is not None and shadir.getValidationState() != expected_state:\n
severity = 1\n
summary = "shadir site is not published %s" % expected_state\n
detail = ""\n
else:\n
severity = 0\n
summary = "Nothing to do."\n
detail = ""\n
\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>
...
...
master/bt5/slapos_cache/SkinTemplateItem/portal_skins/slapos_cache/Alarm_installShacacheWebSite.py
0 → 100644
View file @
6684c59f
portal
=
context
.
getPortalObject
()
shacache
=
getattr
(
portal
.
web_site_module
,
'shacache'
,
None
)
shadir
=
getattr
(
portal
.
web_site_module
,
'shadir'
,
None
)
expected_state
=
context
.
portal_preferences
.
getPreferredShacacheWebsiteExpectedState
(
"published"
)
if
expected_state
==
"published"
and
shacache
is
None
:
shacache
=
portal
.
web_site_module
.
newContent
(
id
=
'shacache'
,
title
=
"Shacache"
)
if
expected_state
==
"published"
and
shadir
is
None
:
shadir
=
portal
.
web_site_module
.
newContent
(
id
=
'shadir'
,
title
=
"Shadir"
)
if
shadir
is
None
and
shacache
is
None
:
# Nothing to do
return
if
expected_state
==
"published"
:
shacache
.
setSkinSelectionName
(
"SHACACHE"
)
shadir
.
setSkinSelectionName
(
"SHADIR"
)
if
expected_state
==
"published"
:
if
portal
.
portal_workflow
.
isTransitionPossible
(
shacache
,
"publish"
):
shacache
.
publish
()
if
portal
.
portal_workflow
.
isTransitionPossible
(
shadir
,
"publish"
):
shadir
.
publish
()
return
if
portal
.
portal_workflow
.
isTransitionPossible
(
shacache
,
"embeed"
):
shacache
.
embeed
()
if
portal
.
portal_workflow
.
isTransitionPossible
(
shadir
,
"embeed"
):
shadir
.
embeed
()
master/bt5/slapos_cache/SkinTemplateItem/portal_skins/slapos_cache/Alarm_installShacacheWebSite.xml
View file @
6684c59f
...
...
@@ -48,46 +48,6 @@
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
portal = context.getPortalObject()\n
shacache = getattr(portal.web_site_module, \'shacache\', None)\n
shadir = getattr(portal.web_site_module, \'shadir\', None)\n
\n
expected_state = context.portal_preferences.getPreferredShacacheWebsiteExpectedState("published")\n
\n
if expected_state == "published" and shacache is None:\n
shacache = portal.web_site_module.newContent(id=\'shacache\', \n
title="Shacache")\n
\n
if expected_state == "published" and shadir is None:\n
shadir = portal.web_site_module.newContent(id=\'shadir\',\n
title="Shadir")\n
\n
if shadir is None and shacache is None:\n
# Nothing to do\n
return \n
\n
if expected_state == "published":\n
shacache.setSkinSelectionName("SHACACHE")\n
shadir.setSkinSelectionName("SHADIR")\n
\n
if expected_state == "published":\n
if portal.portal_workflow.isTransitionPossible(shacache, "publish"):\n
shacache.publish()\n
\n
if portal.portal_workflow.isTransitionPossible(shadir, "publish"):\n
shadir.publish()\n
return\n
\n
\n
if portal.portal_workflow.isTransitionPossible(shacache, "embeed"):\n
shacache.embeed()\n
\n
if portal.portal_workflow.isTransitionPossible(shadir, "embeed"):\n
shadir.embeed()\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
**kw
</string>
</value>
...
...
master/bt5/slapos_cache/SkinTemplateItem/portal_skins/slapos_cache/SystemPreference_viewShacache.xml
View file @
6684c59f
...
...
@@ -2,7 +2,7 @@
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ERP5
Form"
module=
"Products.ERP5Form.Form
"
/>
<global
name=
"ERP5
Form"
module=
"erp5.portal_type
"
/>
</pickle>
<pickle>
<dictionary>
...
...
master/bt5/slapos_cache/bt/revision
deleted
100644 → 0
View file @
f449cb6c
7
\ 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