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
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
a3d0cd99
Commit
a3d0cd99
authored
Oct 09, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
Reduce setup not required code
See merge request
nexedi/slapos.core!576
parents
b90d469e
b0eb77ac
Pipeline
#30338
failed with stage
in 0 seconds
Changes
18
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
22 additions
and
654 deletions
+22
-654
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSecurityGroup.py
...rtal_components/test.erp5.testSlapOSCloudSecurityGroup.py
+2
-2
master/bt5/slapos_configurator/TestTemplateItem/portal_components/test.erp5.testSlapOSConfigurator.py
...tem/portal_components/test.erp5.testSlapOSConfigurator.py
+3
-43
master/bt5/slapos_erp5/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSCheckConsistency.py
...ortal_components/extension.erp5.SlapOSCheckConsistency.py
+0
-10
master/bt5/slapos_erp5/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSCheckConsistency.xml
...rtal_components/extension.erp5.SlapOSCheckConsistency.xml
+0
-106
master/bt5/slapos_erp5/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
...rtalTypePropertySheetTemplateItem/property_sheet_list.xml
+0
-3
master/bt5/slapos_erp5/PropertySheetTemplateItem/portal_property_sheets/MemcachedToolServerConstraint.xml
.../portal_property_sheets/MemcachedToolServerConstraint.xml
+0
-66
master/bt5/slapos_erp5/PropertySheetTemplateItem/portal_property_sheets/MemcachedToolServerConstraint/kumofs_check_server_constraint.xml
...edToolServerConstraint/kumofs_check_server_constraint.xml
+0
-80
master/bt5/slapos_erp5/PropertySheetTemplateItem/portal_property_sheets/MemcachedToolServerConstraint/memcached_check_server_constraint.xml
...oolServerConstraint/memcached_check_server_constraint.xml
+0
-80
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/ERP5Site_getConfigurationCloudoooUrl.xml
...kins/slapos_erp5/ERP5Site_getConfigurationCloudoooUrl.xml
+0
-28
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/MemcachedTool_checkKumofsServerConstraint.py
.../slapos_erp5/MemcachedTool_checkKumofsServerConstraint.py
+0
-23
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/MemcachedTool_checkKumofsServerConstraint.xml
...slapos_erp5/MemcachedTool_checkKumofsServerConstraint.xml
+0
-62
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/MemcachedTool_checkMemcachedServerConsistency.py
...pos_erp5/MemcachedTool_checkMemcachedServerConsistency.py
+0
-23
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/MemcachedTool_checkMemcachedServerConsistency.xml
...os_erp5/MemcachedTool_checkMemcachedServerConsistency.xml
+0
-62
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/SystemPreference_checkConversionServerConsistency.py
...erp5/SystemPreference_checkConversionServerConsistency.py
+6
-9
master/bt5/slapos_erp5/bt/template_extension_id_list
master/bt5/slapos_erp5/bt/template_extension_id_list
+1
-2
master/bt5/slapos_erp5/bt/template_portal_type_property_sheet_list
...5/slapos_erp5/bt/template_portal_type_property_sheet_list
+0
-1
master/bt5/slapos_erp5/bt/template_property_sheet_id_list
master/bt5/slapos_erp5/bt/template_property_sheet_id_list
+1
-2
master/product/SlapOS/tests/testSlapOSMixin.py
master/product/SlapOS/tests/testSlapOSMixin.py
+9
-52
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSecurityGroup.py
View file @
a3d0cd99
...
...
@@ -55,7 +55,7 @@ class TestSlapOSSecurityMixin(SlapOSTestCaseMixin):
"""Checks that a user with login and password exists and can log in to the
system.
"""
uf
=
self
.
getUserFolder
()
uf
=
self
.
portal
.
acl_users
self
.
assertNotEqual
(
uf
.
getUserById
(
user_id
,
None
),
None
)
for
_
,
plugin
in
uf
.
_getOb
(
'plugins'
).
listPlugins
(
IAuthenticationPlugin
):
...
...
@@ -72,7 +72,7 @@ class TestSlapOSSecurityMixin(SlapOSTestCaseMixin):
"""Checks that a user with login and password does not exists and cannot
log in to the system.
"""
uf
=
self
.
getUserFolder
()
uf
=
self
.
portal
.
acl_users
for
plugin_name
,
plugin
in
uf
.
_getOb
(
'plugins'
).
listPlugins
(
IAuthenticationPlugin
):
if
plugin
.
authenticateCredentials
(
...
...
master/bt5/slapos_configurator/TestTemplateItem/portal_components/test.erp5.testSlapOSConfigurator.py
View file @
a3d0cd99
...
...
@@ -25,6 +25,7 @@ from erp5.component.test.SlapOSTestCaseMixin import \
SlapOSTestCaseMixin
import
os
class
TestSlapOSConfigurator
(
SlapOSTestCaseMixin
):
maxDiff
=
None
...
...
@@ -80,53 +81,13 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
self
.
assertEqual
([],
self
.
portal
.
portal_templates
.
TemplateTool_checkBusinessApplicationToModuleConsistency
())
def
testConfiguredVolatileCache
(
self
):
""" Make sure Memcached is configured
"""
if
self
.
isLiveTest
():
# This test is redundant with testConfiguredVolatileCacheViaPromise
# and it is only aims to verify if test environment is behaving as
# expected, nothing else, and if alamrs were invoked.
return
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
\
_getVolatileMemcachedServerDict
memcached_tool
=
self
.
getPortal
().
portal_memcached
connection_dict
=
_getVolatileMemcachedServerDict
()
url_string
=
'erp5-memcached-volatile:%(port)s'
%
connection_dict
self
.
assertEqual
(
memcached_tool
.
default_memcached_plugin
.
getUrlString
(),
url_string
)
def
testConfiguredPersistentCache
(
self
):
""" Make sure Kumofs is configured
"""
if
self
.
isLiveTest
():
# This test is redundant with testConfiguredVolatileCacheViaPromise
# and it is only aims to verify if test environment is behaving as
# expected, nothing else, and if alamrs were invoked.
return
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
\
_getPersistentMemcachedServerDict
memcached_tool
=
self
.
getPortal
().
portal_memcached
connection_dict
=
_getPersistentMemcachedServerDict
()
url_string
=
'erp5-memcached-persistent:%(port)s'
%
connection_dict
self
.
assertEqual
(
memcached_tool
.
persistent_memcached_plugin
.
getUrlString
(),
url_string
)
def
testConfiguredConversionServer
(
self
):
""" Make sure Conversion Server (Cloudooo) is
well configured """
if
self
.
isLiveTest
():
# This test is redundant with testConfiguredConversionServerViaConstraint
# and it is only aims to verify if test environment is behaving as
# expected, nothing else, and if alamrs were invoked.
return
# set preference
preference_tool
=
self
.
portal
.
portal_preferences
conversion_url
=
"https://cloudooo.erp5.net"
self
.
assertEqual
(
preference_tool
.
getPreferredDocumentConversionServerUrl
(),
conversion_url
)
conversion_url
=
[
"https://cloudooo.erp5.net"
]
self
.
assertEqual
(
preference_tool
.
getPreferredDocumentConversionServerUrl
List
(),
conversion_url
)
def
testConfiguredCertificateAuthoring
(
self
):
""" Make sure Certificate Authoting is
...
...
@@ -299,7 +260,6 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
self
.
assertSameSet
(
module_list
,
expected_module_list
)
def
testConfiguredBusinessTemplateList
(
self
):
""" Make sure Installed business Templates are
what it is expected. """
...
...
master/bt5/slapos_erp5/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSCheckConsistency.py
deleted
100644 → 0
View file @
b90d469e
from
App.config
import
getConfiguration
def
getConfigurationCloudoooUrl
(
self
):
try
:
kw
=
getConfiguration
().
product_config
[
'initsite'
]
except
KeyError
:
return
return
kw
.
get
(
"cloudooo_url"
,
None
)
\ No newline at end of file
master/bt5/slapos_erp5/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSCheckConsistency.xml
deleted
100644 → 0
View file @
b90d469e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Extension Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
SlapOSCheckConsistency
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
extension.erp5.SlapOSCheckConsistency
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Extension Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_erp5/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
View file @
a3d0cd99
...
...
@@ -17,9 +17,6 @@
<item>
Reference
</item>
<item>
Url
</item>
</portal_type>
<portal_type
id=
"Memcached Tool"
>
<item>
MemcachedToolServerConstraint
</item>
</portal_type>
<portal_type
id=
"OAuth Tool"
>
<item>
OAuthToolDefaultSlapOSConnector
</item>
</portal_type>
...
...
master/bt5/slapos_erp5/PropertySheetTemplateItem/portal_property_sheets/MemcachedToolServerConstraint.xml
deleted
100644 → 0
View file @
b90d469e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Property Sheet"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
MemcachedToolServerConstraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Sheet
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_erp5/PropertySheetTemplateItem/portal_property_sheets/MemcachedToolServerConstraint/kumofs_check_server_constraint.xml
deleted
100644 → 0
View file @
b90d469e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Script Constraint"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
constraint_type/post_upgrade
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
kumofs_check_server_constraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Script Constraint
</string>
</value>
</item>
<item>
<key>
<string>
script_id
</string>
</key>
<value>
<string>
MemcachedTool_checkKumofsServerConstraint
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_erp5/PropertySheetTemplateItem/portal_property_sheets/MemcachedToolServerConstraint/memcached_check_server_constraint.xml
deleted
100644 → 0
View file @
b90d469e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Script Constraint"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
constraint_type/post_upgrade
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
memcached_check_server_constraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Script Constraint
</string>
</value>
</item>
<item>
<key>
<string>
script_id
</string>
</key>
<value>
<string>
MemcachedTool_checkMemcachedServerConsistency
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/ERP5Site_getConfigurationCloudoooUrl.xml
deleted
100644 → 0
View file @
b90d469e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
getConfigurationCloudoooUrl
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
SlapOSCheckConsistency
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Site_getConfigurationCloudoooUrl
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/MemcachedTool_checkKumofsServerConstraint.py
deleted
100644 → 0
View file @
b90d469e
portal_memcached
=
context
# 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-persistent:2003"
plugin
=
portal_memcached
.
restrictedTraverse
(
"persistent_memcached_plugin"
,
None
)
if
plugin
is
None
:
return
[
"portal_memcached/persistent_memcached_plugin wasn't found!"
]
url
=
plugin
.
getUrlString
()
if
url
!=
expected_url
:
fixing
=
''
if
fixit
:
portal_memcached
.
persistent_memcached_plugin
.
edit
(
url_string
=
expected_url
)
fixing
=
' (fixed)'
return
[
"Kumofs not configured as expected%s: %s"
%
(
fixing
,
"Expect %s
\
n
Got %s"
%
(
expected_url
,
url
))]
return
[]
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/MemcachedTool_checkKumofsServerConstraint.xml
deleted
100644 → 0
View file @
b90d469e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
_params
</string>
</key>
<value>
<string>
fixit=False, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
MemcachedTool_checkKumofsServerConstraint
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/MemcachedTool_checkMemcachedServerConsistency.py
deleted
100644 → 0
View file @
b90d469e
portal_memcached
=
context
# 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
=
plugin
.
getUrlString
()
if
url
!=
expected_url
:
fixing
=
''
if
fixit
:
portal_memcached
.
default_memcached_plugin
.
edit
(
url_string
=
expected_url
)
fixing
=
' (fixed)'
return
[
"Memcached not configured as expected%s: %s"
%
(
fixing
,
"Expect %s
\
n
Got %s"
%
(
expected_url
,
url
))]
return
[]
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/MemcachedTool_checkMemcachedServerConsistency.xml
deleted
100644 → 0
View file @
b90d469e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
_params
</string>
</key>
<value>
<string>
fixit=False, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
MemcachedTool_checkMemcachedServerConsistency
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_erp5/SystemPreference_checkConversionServerConsistency.py
View file @
a3d0cd99
...
...
@@ -9,18 +9,15 @@ if context.getId() == "slapos_default_system_preference" and context.getPreferen
if
context
.
getPreferenceState
()
!=
"global"
:
return
[]
portal
=
context
.
getPortalObject
()
system_preference
=
context
expected_url
=
portal
.
ERP5Site_getConfigurationCloudoooUrl
()
url
=
system_preference
.
getPreferredDocumentConversionServerUrl
()
url
=
context
.
getPreferredDocumentConversionServerUrlList
()
if
expected_url
!=
url
:
if
not
url
:
fixing
=
''
if
fixit
:
system_preference
.
setPreferredDocumentConversionServerUrl
(
expected_url
)
fixing
=
' (fixed)'
# Set some value if no value is set.
context
.
setPreferredDocumentConversionServerUrlList
([
'https://cloudooo1.erp5.net/'
,
'https://cloudooo.erp5.net/'
])
fixing
=
' (fixed, set https://cloudooo1.erp5.net/ and https://cloudooo.erp5.net/)'
error_log
.
append
(
"Conversion Server not configured as expected%s: %s"
%
(
fixing
,
"Expect %s
\
n
Got %s"
%
(
expected_url
,
url
)))
error_log
.
append
(
"Conversion Server is not configured. "
%
fixing
)
return
error_log
master/bt5/slapos_erp5/bt/template_extension_id_list
View file @
a3d0cd99
extension.erp5.SlapOSCheckConsistency
extension.erp5.SlapOSLogin
extension.erp5.SlapOSAdministration
extension.erp5.SlapOSLogin
master/bt5/slapos_erp5/bt/template_portal_type_property_sheet_list
View file @
a3d0cd99
...
...
@@ -6,7 +6,6 @@ Contract Invitation Token | Url
Id Tool | SlapOSModuleIdGeneratorConstraint
Invitation Token | Reference
Invitation Token | Url
Memcached Tool | MemcachedToolServerConstraint
OAuth Tool | OAuthToolDefaultSlapOSConnector
Organisation | GeographicOrganisation
Template Tool | TemplateToolBusinessApplicationModuleCategoryConstraint
...
...
master/bt5/slapos_erp5/bt/template_property_sheet_id_list
View file @
a3d0cd99
PreferenceSlapOSConstraintPreference
CertificateAuthorityToolConsistencyConstraint
SlapOSModuleIdGeneratorConstraint
MemcachedToolServerConstraint
GeographicOrganisation
WebSiteModuleShacacheConstraint
ShacacheSystemPreference
...
...
master/product/SlapOS/tests/testSlapOSMixin.py
View file @
a3d0cd99
...
...
@@ -30,7 +30,6 @@ import random
import
transaction
import
unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
DummyMailHost
from
Products.ERP5Type.Utils
import
convertToUpperCase
import
os
import
glob
...
...
@@ -131,28 +130,10 @@ class testSlapOSMixin(ERP5TypeTestCase):
# XXX - What is the better way to know if we are in live test mode ?
return
not
os
.
environ
.
has_key
(
'TEST_CA_PATH'
)
def
_setUpDummyMailHost
(
self
):
"""Do not play with NON persistent replacement of MailHost"""
if
not
self
.
isLiveTest
():
ERP5TypeTestCase
.
_setUpDummyMailHost
(
self
)
def
_restoreMailHost
(
self
):
"""Do not play with NON persistent replacement of MailHost"""
if
not
self
.
isLiveTest
():
ERP5TypeTestCase
.
_restoreMailHost
(
self
)
def
beforeTearDown
(
self
):
if
self
.
isLiveTest
():
self
.
deSetUpPersistentDummyMailHost
()
if
self
.
abort_transaction
:
transaction
.
abort
()
def
getUserFolder
(
self
):
"""
Return the user folder
"""
return
getattr
(
self
.
getPortal
(),
'acl_users'
,
None
)
def
setUpOnce
(
self
):
self
.
commit
()
self
.
portal
.
portal_templates
.
updateRepositoryBusinessTemplateList
(
...
...
@@ -160,47 +141,24 @@ class testSlapOSMixin(ERP5TypeTestCase):
self
.
commit
()
self
.
launchConfigurator
()
def
updateInitSite
(
self
):
self
.
portal
.
portal_caches
.
updateCache
()
try
:
initsite
=
config
.
product_config
[
"initsite"
]
except
KeyError
:
initsite
=
{}
if
initsite
.
get
(
"cloudooo_url"
,
None
)
is
None
:
initsite
[
"cloudooo_url"
]
=
"https://cloudooo.erp5.net"
config
.
product_config
[
"initsite"
]
=
initsite
self
.
commit
()
def
afterSetUp
(
self
):
self
.
login
()
self
.
createAlarmStep
()
self
.
portal
.
email_from_address
=
'romain@nexedi.com'
self
.
portal
.
email_to_address
=
'romain@nexedi.com'
if
self
.
isLiveTest
():
self
.
setUpPersistentDummyMailHost
()
return
if
getattr
(
self
.
portal
.
portal_caches
,
'erp5_site_global_id'
,
None
):
# we are not on live test so multiple tests can run in parallel
# so ensure that each start tests from scratch
self
.
portal
.
portal_caches
.
erp5_site_global_id
=
'%s'
%
random
.
random
()
self
.
portal
.
portal_caches
.
_p_changed
=
1
self
.
createCertificateAuthorityFile
()
self
.
commit
()
self
.
updateInitSite
()
def
deSetUpPersistentDummyMailHost
(
self
):
if
'MailHost'
in
self
.
portal
.
objectIds
():
self
.
portal
.
manage_delObjects
([
'MailHost'
])
self
.
portal
.
manage_addProduct
[
'MailHost'
].
manage_addMailHost
(
'MailHost'
)
if
self
.
isLiveTest
():
return
self
.
createCertificateAuthorityFile
()
self
.
commit
()
def
setUpPersistentDummyMailHost
(
self
):
if
'MailHost'
in
self
.
portal
.
objectIds
():
self
.
portal
.
manage_delObjects
([
'MailHost'
])
self
.
portal
.
_setObject
(
'MailHost'
,
DummyMailHost
(
'MailHost'
))
self
.
portal
.
email_from_address
=
'romain@nexedi.com'
self
.
portal
.
email_to_address
=
'romain@nexedi.com'
def
getBusinessConfiguration
(
self
):
return
self
.
portal
.
business_configuration_module
[
\
"slapos_master_configuration_workflow"
]
...
...
@@ -208,7 +166,6 @@ class testSlapOSMixin(ERP5TypeTestCase):
def
launchConfigurator
(
self
):
self
.
logMessage
(
'SlapOS launchConfigurator ...
\
n
'
)
self
.
login
()
self
.
updateInitSite
()
# Create new Configuration
business_configuration
=
self
.
getBusinessConfiguration
()
...
...
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