Revision d30f29aa snf-cyclades-app/synnefo/logic/management/commands/reconcile.py
b/snf-cyclades-app/synnefo/logic/management/commands/reconcile.py | ||
---|---|---|
44 | 44 |
from django.core.management.base import BaseCommand, CommandError |
45 | 45 |
|
46 | 46 |
from synnefo.db.models import VirtualMachine |
47 |
from synnefo.logic import reconciliation, backend |
|
47 |
from synnefo.logic import reconciliation, backend, utils
|
|
48 | 48 |
|
49 | 49 |
|
50 | 50 |
class Command(BaseCommand): |
... | ... | |
202 | 202 |
len(orphans) |
203 | 203 |
for id in orphans: |
204 | 204 |
vm = VirtualMachine.objects.get(pk=id) |
205 |
vm.client.DeleteInstance('%s%s' % |
|
206 |
(settings.BACKEND_PREFIX_ID, str(id))) |
|
205 |
vm.client.DeleteInstance(utils.id_to_instance_name(id)) |
|
207 | 206 |
print >> sys.stderr, " ...done" |
208 | 207 |
|
209 | 208 |
if options['fix_unsynced'] and len(unsynced) > 0: |
Also available in: Unified diff