Revision f5b4f2a3 snf-cyclades-app/synnefo/logic/management/commands/reconcile.py
b/snf-cyclades-app/synnefo/logic/management/commands/reconcile.py | ||
---|---|---|
44 | 44 |
|
45 | 45 |
from synnefo.db.models import VirtualMachine |
46 | 46 |
from synnefo.logic import reconciliation, backend |
47 |
from synnefo.util.rapi import GanetiRapiClient |
|
48 | 47 |
|
49 | 48 |
|
50 | 49 |
class Command(BaseCommand): |
... | ... | |
156 | 155 |
"Issuing OP_INSTANCE_REMOVE for %d Ganeti instances:" % \ |
157 | 156 |
len(orphans) |
158 | 157 |
for id in orphans: |
159 |
rapi = GanetiRapiClient(*settings.GANETI_CLUSTER_INFO)
|
|
160 |
rapi.DeleteInstance('%s%s' %
|
|
158 |
vm = VirtualMachine.objects.get(pk=id)
|
|
159 |
vm.client.DeleteInstance('%s%s' %
|
|
161 | 160 |
(settings.BACKEND_PREFIX_ID, str(id))) |
162 | 161 |
print >> sys.stderr, " ...done" |
163 | 162 |
|
Also available in: Unified diff