Comment 0 for bug 1336196

Revision history for this message
Assaf Muller (amuller) wrote :

Ports, networks and subnets have a do_delete=True parameter. By default, these resources are deleted at the end of the context manager scope. All other resources use a different semantic: no_delete=False.

This causes confusing situations such as:
with self.subnet(network, do_delete=False) as subnet:
    with self.security_group(no_delete=True) as sg:
        pass

I personally fell to the pitfall of using do_delete for the security group and was surprised when it wasn't deleted at the end of the scope.