Commit 1955ab6a authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: Update Conversion Server Constraint to use value from initsite (at zope.conf)

parent 0d311248
......@@ -7,26 +7,16 @@ if context.getPreferenceState() != "global":
portal = context.getPortalObject()
system_preference = context
promise_url = portal.getPromiseParameter('external_service', 'cloudooo_url')
expected_url = portal.ERP5Site_getConfigurationCloudoooUrl()
if promise_url is None:
return
url = system_preference.getPreferredDocumentConversionServerUrl()
url = "cloudooo://%s:%s/" % (system_preference.getPreferredOoodocServerAddress(), system_preference.getPreferredOoodocServerPortNumber())
if promise_url != url:
if expected_url != url:
fixing = ''
if fixit:
domain_port = promise_url.split('//')[1].split('/')[0]
port = domain_port.split(':')[-1]
domain = domain_port[:-(len(port)+1)]
system_preference.edit(
preferred_ooodoc_server_address=domain,
preferred_ooodoc_server_port_number=port,
)
system_preference.setPreferredDocumentConversionServerUrl(expected_url)
fixing = ' (fixed)'
return ["Conversion Server not configured as expected%s: %s" %
(fixing, "Expect %s\nGot %s" % (promise_url, url))]
(fixing, "Expect %s\nGot %s" % (expected_url, url))]
else:
return []
extension.erp5.SlapOSCheckConsistency
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment