camptocamp / c2cgeoportal

c2cgeoportal application
http://geomapfish.org
Other
64 stars 46 forks source link

c2c-template error on development.ini #1245

Closed arnaud-morvan closed 9 years ago

arnaud-morvan commented 9 years ago
$ make -f amorvan.mk build
INSTANCE_ID=amorvan DEVELOPMENT=TRUE PACKAGE=aprona .build/venv/bin/c2c-template --vars vars_amorvan.yaml --engine mako --files development.ini.mako
ERROR: Unable to update the path 'authtkt', types '<type 'dict'>', '<type 'NoneType'>'.
Traceback (most recent call last):
  File ".build/venv/bin/c2c-template", line 9, in <module>
    load_entry_point('c2c.template==1.1.0.dev2', 'console_scripts', 'c2c-template')()
  File "/home/amorvan/aprona_websig/.build/venv/local/lib/python2.7/site-packages/c2c/template.py", line 150, in main
    _proceed(files, used_vars, options)
  File "/home/amorvan/aprona_websig/.build/venv/local/lib/python2.7/site-packages/c2c/template.py", line 174, in _proceed
    bottle_template(files, used_vars, engine)
  File "/home/amorvan/aprona_websig/.build/venv/local/lib/python2.7/site-packages/c2c/template.py", line 199, in bottle_template
    template, **used_vars
  File "/home/amorvan/aprona_websig/.build/venv/bin/bottle.py", line 3595, in template
    return TEMPLATES[tplid].render(kwargs)
  File "/home/amorvan/aprona_websig/.build/venv/bin/bottle.py", line 3280, in render
    return self.tpl.render(**_defaults)
  File "/home/amorvan/aprona_websig/.build/venv/local/lib/python2.7/site-packages/mako/template.py", line 443, in render
    return runtime._render(self, self.callable_, args, data)
  File "/home/amorvan/aprona_websig/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 803, in _render
    **_kwargs_for_callable(callable_, data))
  File "/home/amorvan/aprona_websig/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 835, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/home/amorvan/aprona_websig/.build/venv/local/lib/python2.7/site-packages/mako/runtime.py", line 860, in _exec_template
    callable_(context, *args, **kwargs)
  File "development_ini_mako", line 23, in render_body
TypeError: 'Undefined' object has no attribute '__getitem__'
make: *** [development.ini] Error 1
arnaud-morvan commented 9 years ago

in CONST_vars.yaml, we have:

    # cookie session secret
    authtkt_secret: __import__('uuid').uuid4().hex
...
    # Authentication settings
    authtkt_cookie_name: auth_tkt_{instanceid}

in development.ini.mako, we have:

    authtkt_secret = ${authtkt["secret"]}
    authtkt_cookie_name = ${authtkt["cookie_name"]}

in .yaml, we have:

    authtkt:
        # One day
        timeout: 86400

this is not consistent

sbrunner commented 9 years ago

Your CONST_vars.yaml is too old ... https://github.com/camptocamp/demo_geomapfish/blob/master/CONST_vars.yaml#L65-L70