Revision 67c08a61

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

  
b/snf-cyclades-app/synnefo/logic/management/commands/backend-modify.py
57 57
        make_option('--drained',
58 58
            dest='drained',
59 59
            action='store_true',
60
            default=False,
61 60
            help="Set the backend as drained to exclude from allocation "\
62 61
                 "operations"),
63 62
        make_option('--no-drained',
......
66 65
        make_option('--offline',
67 66
            dest='offline',
68 67
            action='store_true',
69
            default=False,
70 68
            help="Set the backend as offline to not communicate in order "\
71 69
                 "to avoid delays"),
72 70
        make_option('--no-offline',

Also available in: Unified diff