• Jérome Perrin's avatar
    slapos/proxy: support forwarding requests as a partition · c755cba8
    Jérome Perrin authored
    In SlapOS, both users or partitions can requests partitions. With the
    multimaster support of slapos proxy, all requests where made as a user,
    but in the case of recursive slapos - where a partition from the "outer"
    slapos includes an "inner" slapos, it makes sense to forward partitions
    requests as the partition in the "outer" slapos - this way when this
    partition is destroyed all partitions that might have been requested are
    also destroyed.
    
    To request as partition, the multi-master entry must define two extra
    keys:
     - computer, that can be optained by $${slap-configuration:computer}
    from instance buildout
     - partition, that can be optained by $${slap-configuration:partition}
    
    When these are not set, the request will be made as a user, like it was
    the case before.
    
    We also change the test to unset SLAPGRID_INSTANCE_ROOT because this
    implementation has side effect - the environment variable is set and
    never unset. Without this, test fail when running the full test suite
    because a previous test was leaking SLAPGRID_INSTANCE_ROOT. This is
    definitely something we'll have to improve later.
    c755cba8
test_slapproxy.py 76.9 KB