• Jérome Perrin's avatar
    userinfo: expose values as string · f06e61a6
    Jérome Perrin authored
    To be compatible with buildout (and not only `slapos.recipe.template:jinja2`)
    
    See [#20180416-1138FFA](https://nexedi.erp5.net/bug_module/20180416-1138FFA/)
    
    ---
    
    Running this buildout:
    
    ```
    [buildout]
    parts=x
    
    [userinfo]
    recipe = slapos.cookbook:userinfo
    
    [x]
    recipe = plone.recipe.command
    command = echo "Hello user id ${userinfo:pw-uid}"
    ```
    
    
    In a slapos patched buildout it outputs: `"Hello user id !py!991"` (which means it's not usable for references directly in other buildout parts)
    
    In a "non patched" buildout fail with error:
    
    ```
    While:
      Installing.
      Getting section x.
      Initializing section x.
      Getting option x:command.
      Getting section userinfo.
      Initializing section userinfo.
    
    An internal error occurred due to a bug in either zc.buildout or in a
    recipe being used:
    Traceback (most recent call last):
      File "/tmp/x/env/lib/python2.7/site-packages/zc/buildout/buildout.py", line 2127, in main
        getattr(buildout, command...
    f06e61a6
test_userinfo.py 836 Bytes