← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1336196] [NEW] Inconsistent keyword for automatic deletion of resources during unit tests

 

Public bug reported:

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.

Finally, the double negative of no_delete=False is confusing and should
be avoided.

** Affects: neutron
     Importance: Undecided
     Assignee: Assaf Muller (amuller)
         Status: In Progress


** Tags: unittest

** Changed in: neutron
     Assignee: (unassigned) => Assaf Muller (amuller)

** Description changed:

  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
+     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.
+ 
+ Finally, the double negative of no_delete=False is confusing and should
+ be avoided.

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1336196

Title:
  Inconsistent keyword for automatic deletion of resources during unit
  tests

Status in OpenStack Neutron (virtual network service):
  In Progress

Bug description:
  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.

  Finally, the double negative of no_delete=False is confusing and
  should be avoided.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1336196/+subscriptions


Follow ups

References