Revision 67c08a61 snf-cyclades-app/synnefo/db/models.py

b/snf-cyclades-app/synnefo/db/models.py
505 505

  
506 506
        old_state = self.state
507 507

  
508
        backend_states = [s.operstate for s in self.backend_networks.all()]
508
        backend_states = [s.operstate for s in
509
                          self.backend_networks.filter(backend__offline=False)]
509 510
        if not backend_states:
510 511
            self.state = 'PENDING'
511 512
            self.save()
......
534 535
    def create_backend_network(self, backend=None):
535 536
        """Create corresponding BackendNetwork entries."""
536 537

  
537
        backends = [backend] if backend else Backend.objects.all()
538
        backends = [backend] if backend\
539
                             else Backend.objects.filter(offline=False)
538 540
        for backend in backends:
539 541
            BackendNetwork.objects.create(backend=backend, network=self)
540 542

  

Also available in: Unified diff