Commit bf6b2ef3 authored by Kirill Smelkov's avatar Kirill Smelkov

X restore promises

After escaping strings with dumps (to avoid buildout breakage and code
injection on "tricky" references, e.g. with spaces), promises started to be
generated with !py! prefix in their filenames, e.g. as

    '!py!'\''RU1-sdr-busy.py'\'''

instead of just

    RU1-sdr-busy.py

The issue here is that our code set

    name = !py!'RU1-sdr-busy.py'

and then monitor-promise-base from stack/monitor does

    output = ${directory:plugins}/${:name}

which, I though, would be expanded to .../etc/plugin/RU1-sdr-busy.py but it did
not deserialized the :name upon expansion.

I feel like it is maybe a bug in nexedi/slapos.buildout@4e13dcb9 , but I'm not sure.

Anyway, workaround the problem by generating :output ourselve also via escaped way.
parent ad2199b1
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = 9ec3fde7ef51752fd393da51e9f4be51 md5sum = a3527093ffc01d8f8fbaf27696ad7b9b
[template-ors] [template-ors]
filename = instance-ors.cfg filename = instance-ors.cfg
...@@ -28,7 +28,7 @@ md5sum = 55d9182051ce13d07f1bc8e019173ae5 ...@@ -28,7 +28,7 @@ md5sum = 55d9182051ce13d07f1bc8e019173ae5
[ru_libinstance.jinja2.cfg] [ru_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/libinstance.jinja2.cfg _update_hash_filename_ = ru/libinstance.jinja2.cfg
md5sum = 415d002d8f89e11194de24223edb3b02 md5sum = 21b7f5611c20dc6f29e4e1e456493234
[ru_sdr_libinstance.jinja2.cfg] [ru_sdr_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg _update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg
......
...@@ -34,6 +34,7 @@ context = ...@@ -34,6 +34,7 @@ context =
key eggs_directory buildout:eggs-directory key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory key develop_eggs_directory buildout:develop-eggs-directory
raw buildout_directory ${buildout:directory} raw buildout_directory ${buildout:directory}
section directory directory
raw pythonwitheggs ${pythonwitheggs:exe} raw pythonwitheggs ${pythonwitheggs:exe}
section slap_connection slap-connection section slap_connection slap-connection
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
{{ part('promise-'+name) }} {{ part('promise-'+name) }}
<= monitor-promise-base <= monitor-promise-base
name = {{ dumps('%s.py' % pretty_name) }} name = {{ dumps('%s.py' % pretty_name) }}
output = {{ dumps('%s/plugin/%s.py' % (directory.etc, pretty_name)) }}
config-testing = {{ testing }} config-testing = {{ testing }}
config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }} config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
{%- endmacro %} {%- endmacro %}
......
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