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
Guillaume Hervier
slapos.core
Commits
dee40c68
Commit
dee40c68
authored
Nov 22, 2017
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: Update contraints to rely on default information after removal erp5_promise
parent
6bfde5ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
30 deletions
+23
-30
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/MemcachedTool_checkKumofsServerConstraint.py
.../slapos_erp5/MemcachedTool_checkKumofsServerConstraint.py
+9
-14
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/MemcachedTool_checkMemcachedServerConsistency.py
...pos_erp5/MemcachedTool_checkMemcachedServerConsistency.py
+14
-16
No files found.
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/MemcachedTool_checkKumofsServerConstraint.py
View file @
dee40c68
portal_memcached
=
context
portal_memcached
=
context
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
promise_url
=
portal
.
getPromiseParameter
(
'external_service'
,
'kumofs_url'
)
if
promise_url
is
None
:
# erp5-memcached-persistent is provided by SlapOS, so here we are
return
# ensuring the site uses real DNS Configuration provided by SlapOS.
# Port and name is hardcoded (unfortunally).
expected_url
=
"erp5-memcached-persistent:2003"
plugin
=
portal_memcached
.
restrictedTraverse
(
"persistent_memcached_plugin"
,
None
)
plugin
=
portal_memcached
.
restrictedTraverse
(
"persistent_memcached_plugin"
,
None
)
if
plugin
is
None
:
if
plugin
is
None
:
return
[]
return
[
"portal_memcached/persistent_memcached_plugin wasn't found!"
]
url
=
"memcached://%s/"
%
plugin
.
getUrlString
()
url
=
plugin
.
getUrlString
()
if
promise_url
!=
url
:
if
url
!=
expected_
url
:
fixing
=
''
fixing
=
''
if
fixit
:
if
fixit
:
_
,
promise_url
=
promise_url
.
split
(
'://'
,
1
)
portal_memcached
.
persistent_memcached_plugin
.
edit
(
url_string
=
expected_url
)
domain_port
=
promise_url
.
split
(
'/'
,
1
)[
0
]
port
=
domain_port
.
split
(
':'
)[
-
1
]
domain
=
domain_port
[:
-
(
len
(
port
)
+
1
)]
portal_memcached
.
persistent_memcached_plugin
.
edit
(
url_string
=
"%s:%s"
%
(
domain
,
port
))
fixing
=
' (fixed)'
fixing
=
' (fixed)'
return
[
"Kumofs not configured as expected%s: %s"
%
return
[
"Kumofs not configured as expected%s: %s"
%
(
fixing
,
"Expect %s
\
n
Got %s"
%
(
promise
_url
,
url
))]
(
fixing
,
"Expect %s
\
n
Got %s"
%
(
expected
_url
,
url
))]
return
[]
return
[]
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/MemcachedTool_checkMemcachedServerConsistency.py
View file @
dee40c68
portal_memcached
=
context
portal_memcached
=
context
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
promise_url
=
portal
.
getPromiseParameter
(
'external_service'
,
'memcached_url'
)
if
promise_url
is
None
:
return
plugin
=
portal_memcached
.
default_memcached_plugin
# erp5-memcached-persistent is provided by SlapOS, so here we are
# ensuring the site uses real DNS Configuration provided by SlapOS.
# Port and name is hardcoded (unfortunally).
expected_url
=
"erp5-memcached-volatile:2013"
plugin
=
portal_memcached
.
restrictedTraverse
(
"default_memcached_plugin"
,
None
)
if
plugin
is
None
:
return
[
"portal_memcached/default_memcached_plugin wasn't found!"
]
url
=
"memcached://%s/"
%
plugin
.
getUrlString
()
url
=
plugin
.
getUrlString
()
if
promise_url
!=
url
:
if
url
!=
expected_
url
:
fixing
=
''
fixing
=
''
if
fixit
:
if
fixit
:
portal_memcached
.
default_memcached_plugin
.
edit
(
url_string
=
expected_url
)
fixing
=
' (fixed)'
fixing
=
' (fixed)'
_
,
promise_url
=
promise_url
.
split
(
'://'
,
1
)
domain_port
=
promise_url
.
split
(
'/'
,
1
)[
0
]
port
=
domain_port
.
split
(
':'
)[
-
1
]
domain
=
domain_port
[:
-
(
len
(
port
)
+
1
)]
portal_memcached
.
default_memcached_plugin
.
edit
(
url_string
=
"%s:%s"
%
(
domain
,
port
))
return
[
"Memcached not configured as expected%s: %s"
%
return
[
"Memcached not configured as expected%s: %s"
%
(
fixing
,
"Expect %s
\
n
Got %s"
%
(
promise
_url
,
url
))]
(
fixing
,
"Expect %s
\
n
Got %s"
%
(
expected
_url
,
url
))]
else
:
return
[]
return
[]
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