a suggestion here might be to have a single add cleanup with wait function  instead of relying on the caller to call both addcleanup and then  append wait might look something like this  def add cleanup with wait self  resource id  delete callable  wait resource  error status  error exc type nova exceptions notfound self addcleanup delete callable  resource id wait dict self cleanup waits append wait dict and then called like so self add cleanup with wait server id  server delete  self compute client servers 