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": ...@@ -7,26 +7,16 @@ if context.getPreferenceState() != "global":
portal = context.getPortalObject() portal = context.getPortalObject()
system_preference = context system_preference = context
promise_url = portal.getPromiseParameter('external_service', 'cloudooo_url') expected_url = portal.ERP5Site_getConfigurationCloudoooUrl()
if promise_url is None: url = system_preference.getPreferredDocumentConversionServerUrl()
return
url = "cloudooo://%s:%s/" % (system_preference.getPreferredOoodocServerAddress(), system_preference.getPreferredOoodocServerPortNumber()) if expected_url != url:
if promise_url != url:
fixing = '' fixing = ''
if fixit: if fixit:
domain_port = promise_url.split('//')[1].split('/')[0] system_preference.setPreferredDocumentConversionServerUrl(expected_url)
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,
)
fixing = ' (fixed)' fixing = ' (fixed)'
return ["Conversion Server not configured as expected%s: %s" % 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: else:
return [] 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