Commit b1f85ddf authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

software.apache-frontend: Remove unecessary "raw" call

parent 24524587
......@@ -56,7 +56,7 @@ mode = 0644
[template-apache-frontend]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-apache-frontend.cfg
md5sum = 6d437f8a3836484d42bf9bf8d747e201
md5sum = c86c435136f6b910b3dd7dcb84a789a2
output = ${buildout:directory}/template-apache-frontend.cfg
mode = 0644
......
......@@ -147,6 +147,15 @@ extra-context =
key http_port instance-parameter:configuration.plain_http_port
key https_port instance-parameter:configuration.port
[software-release-path]
template-empty = ${template-empty:target}
template-slave-configuration = ${template-slave-configuration:target}
template-default-slave-virtualhost = ${template-default-slave-virtualhost:target}
template-cached-slave-virtualhost = ${template-cached-slave-virtualhost:target}
template-nginx-eventsource-slave-virtualhost = ${template-nginx-eventsource-slave-virtualhost:target}
template-nginx-notebook-slave-virtualhost = ${template-nginx-notebook-slave-virtualhost:target}
apache-location = ${apache-2.2:location}
[dynamic-custom-personal-template-slave-list]
< = jinja2-template-base
template = ${template-slave-list:target}
......@@ -172,12 +181,12 @@ extra-context =
key global_ipv6 slap-network-information:global-ipv6
key cache_port apache-configuration:cache-port
key varnginx directory:varnginx
raw empty_template ${template-empty:target}
raw template_custom_slave_configuration ${template-slave-configuration:target}
raw template_default_slave_configuration ${template-default-slave-virtualhost:target}
raw template_cached_slave_configuration ${template-cached-slave-virtualhost:target}
raw template_eventsource_slave_configuration ${template-nginx-eventsource-slave-virtualhost:target}
raw template_notebook_slave_configuration ${template-nginx-notebook-slave-virtualhost:target}
key empty_template software-release-path:template-empty
key template_custom_slave_configuration software-release-path:template-slave-configuration
key template_default_slave_configuration software-release-path:template-default-slave-virtualhost
key template_cached_slave_configuration software-release-path:template-cached-slave-virtualhost
key template_eventsource_slave_configuration software-release-path:template-nginx-eventsource-slave-virtualhost
key template_notebook_slave_configuration software-release-path:template-nginx-notebook-slave-virtualhost
raw software_type single-custom-personal
section logrotate_dict logrotate
section frontend_configuration frontend-configuration
......@@ -202,7 +211,7 @@ extra-context =
template = ${template-apache-frontend-configuration:target}
rendered = $${apache-configuration:frontend-configuration}
extra-context =
raw httpd_home ${apache-2.2:location}
key httpd_home software-release-path:apache-location
key httpd_mod_ssl_cache_directory apache-directory:mod-ssl
key domain instance-parameter:configuration.domain
key document_root apache-directory:document-root
......
  • Thanks, it's better this way.

    I guess you started in the idea of using section on the first half, as the added software-release-path seems superfluous now. But this not worth a specific second fix anyway.

  • But this not worth a specific second fix anyway.

    I'd say yes because you have twice more lines for the same thing. The code is becoming a maze. Instead of:

        raw empty_template ${template-empty:target} 

    why not simply:

        key empty_template template-empty:target
  • This is not possible. template-empty and the other sections are rendered during software build, they doesn't exists when this buildout file is processed at instanciation.

  • Ah, this is already a template ? Sorry I did not identify it as such (although it does not invalidate my comment on the previous commit). In this case, even with jinja2 template the number of lines is the same, but with jinja2 the dumps() global would allow escaping safely these values - the lack of which is one of the shortcommings of the old template scheme.

    A bit of background: This difficulty in quickly idenitifying whether the current file is a template or directly a buildout file is a problems of the old templating scheme. It makes such little-context-available patches unnecessarily hard to review accurately. And I believe it is confusing to all newcomers. Many reasons why I want to see this templating system die...

    Anyway, my biggest issue at the moment is that there are so many invalid raw uses everywhere. This is what I want to raise awareness of at the moment, so it stops spreading ASAP (I left similar review on several other commits introducing other instances of missuse).

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