Revision 27cda06b snf-cyclades-app/synnefo/logic/backend.py

b/snf-cyclades-app/synnefo/logic/backend.py
256 256
        return
257 257

  
258 258
    backend_states = [s.operstate for s in network.backend_networks.all()]
259
    if not backend_states:
259
    if not backend_states and network.action != "DESTROY":
260 260
        if network.state != "ACTIVE":
261 261
            network.state = "ACTIVE"
262 262
            network.save()
263 263
            return
264 264

  
265 265
    # Network is deleted when all BackendNetworks go to "DELETED" operstate
266
    deleted = reduce(lambda x, y: x == y, backend_states, 'DELETED')
266
    deleted = reduce(lambda x, y: x == y and "DELETED", backend_states,
267
                     "DELETED")
267 268

  
268 269
    # Release the resources on the deletion of the Network
269 270
    if deleted:

Also available in: Unified diff