Revision 1464a17b

b/snf-cyclades-app/synnefo/logic/reconciliation.py
146 146
                    self.reconcile_building_server(db_server)
147 147
                elif build_status != "RUNNING":
148 148
                    stale.append(server_id)
149
            elif (db_server.operstate == "ERROR" and
150
                  db_server.action != "DESTROY"):
151
                # Servers at building ERROR are stale only if the user has
152
                # asked to destroy them.
153
                pass
149 154
            else:
150 155
                stale.append(server_id)
151 156

  
b/snf-cyclades-app/synnefo/logic/tests/reconciliation.py
89 89
        vm1 = mfactory.VirtualMachineFactory(backend=self.backend,
90 90
                                             deleted=False,
91 91
                                             operstate="ERROR")
92

  
92 93
        with mocked_quotaholder():
93 94
            self.reconciler.reconcile()
94 95
        vm1 = VirtualMachine.objects.get(id=vm1.id)
95
        self.assertTrue(vm1.deleted)
96
        self.assertFalse(vm1.deleted)
97
        vm2 = mfactory.VirtualMachineFactory(backend=self.backend,
98
                                             deleted=False,
99
                                             action="DESTROY",
100
                                             operstate="ERROR")
101
        with mocked_quotaholder():
102
            self.reconciler.reconcile()
103
        vm2 = VirtualMachine.objects.get(id=vm2.id)
104
        self.assertTrue(vm2.deleted)
105
        vm3 = mfactory.VirtualMachineFactory(backend=self.backend,
106
                                             deleted=False,
107
                                             action="DESTROY",
108
                                             operstate="ACTIVE")
109
        with mocked_quotaholder():
110
            self.reconciler.reconcile()
111
        vm3 = VirtualMachine.objects.get(id=vm3.id)
112
        self.assertTrue(vm3.deleted)
96 113

  
97 114
    def test_orphan_server(self, mrapi):
98 115
        cmrapi = self.reconciler.client

Also available in: Unified diff