1. 27 Apr, 2018 1 commit
    • 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)(args)
        File "/tmp/x/env/lib/python2.7/site-packages/zc/buildout/buildout.py", line 681, in install
          [self[part]['recipe'] for part in install_parts]
        File "/tmp/x/env/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1278, in __getitem__
          options._initialize()
        File "/tmp/x/env/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1376, in _initialize
          self._dosub(k, v)
        File "/tmp/x/env/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1431, in _dosub
          v = '$$'.join([self._sub(s, seen) for s in v.split('$$')])
        File "/tmp/x/env/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1495, in _sub
          v = self.buildout[section].get(option, None, seen)
        File "/tmp/x/env/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1278, in __getitem__
          options._initialize()
        File "/tmp/x/env/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1386, in _initialize
          self.initialize()
        File "/tmp/x/env/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1395, in initialize
          self.recipe = recipe_class(buildout, name, self)
        File "/tmp/x/eggs/slapos.cookbook-1.0.62-py2.7.egg/slapos/recipe/userinfo.py", line 13, in __init__
          options['pw-uid'] = pinfo.pw_uid
        File "/tmp/x/env/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1520, in __setitem__
          raise TypeError('Option values must be strings', value)
      TypeError: ('Option values must be strings', 991)
      ```
      
      /cc @Nicolas @alain.takoudjou  @vpelletier 
      
      /reviewed-on !321
      f06e61a6
  2. 25 Apr, 2018 1 commit
  3. 24 Apr, 2018 3 commits
  4. 23 Apr, 2018 1 commit
  5. 17 Apr, 2018 3 commits
  6. 16 Apr, 2018 6 commits
  7. 15 Apr, 2018 2 commits
  8. 13 Apr, 2018 2 commits
  9. 12 Apr, 2018 6 commits
  10. 10 Apr, 2018 9 commits
  11. 07 Apr, 2018 1 commit
  12. 06 Apr, 2018 1 commit
  13. 05 Apr, 2018 1 commit
  14. 04 Apr, 2018 3 commits
    • Julien Muchembled's avatar
      096993a3
    • Kazuhiko Shiozaki's avatar
    • Jérome Perrin's avatar
      slapos-testing: use buildout to install eggs · b9f53fc3
      Jérome Perrin authored
      Instead of having running test installing eggs with setuptools during `python setup.py test`, which fails for `caucase` because one of its dependency (namely `cryptography`) cannot be installed so easily, we want to install the dependencies via buildout, using the same installation methods than in the actual software profiles using our eggs.
      
      What I initially believed would be a small change turned out to be a long journey, especially because of using a develop version of `slapos.recipe.cmmi` caused signature changes in the parts installed by this recipe ( `git`, `openssl` etc - some parts that takes a bit of time to install ) so I had to fight with the software being reinstalled each time. Even though the cases which leads to reinstallation are understood (this even involved fixing a bug in buildout slapos.buildout!14 ), this is still the case. Some solutions are proposed in the commit message of f4b6eeda , but this reached a state where we can consider first merging with this known problem or discuss ways of improving that before merging if it's considered as blocking. Current state is that it takes one hour to re-install what has to be reinstalled and run the test suite on test runner.
      
      Despite this issue, this approach already improve things, because:
       * `caucase` tests are running (and passing)
       * some `slapos.cookbook` are improved so that they reuse eggs from the buildout and do not install again eggs when the are run.
       *  ... and some other small cleanups
      
      This depends on erp5!619 on the `erp5.util` side.
      
      /reviewed-on !309
      b9f53fc3