Revision a6e6fe48 snf-cyclades-app/synnefo/logic/management/commands/backend-remove.py

b/snf-cyclades-app/synnefo/logic/management/commands/backend-remove.py
1
# Copyright 2011-2012 GRNET S.A. All rights reserved.
1
# Copyright 2011-2014 GRNET S.A. All rights reserved.
2 2
#
3 3
# Redistribution and use in source and binary forms, with or without
4 4
# modification, are permitted provided that the following conditions
......
29 29
#
30 30

  
31 31
from django.core.management.base import BaseCommand, CommandError
32
from synnefo.management.common import get_backend
32
from synnefo.management import common
33 33
from synnefo.logic import backend as backend_mod
34 34
from synnefo.db.models import Backend
35 35
from django.db import transaction, models
......
50 50
        if len(args) < 1:
51 51
            raise CommandError("Please provide a backend ID")
52 52

  
53
        backend = get_backend(args[0])
53
        backend = common.get_resource("backend", args[0], for_update=True)
54 54

  
55 55
        write("Trying to remove backend: %s\n" % backend.clustername)
56 56

  

Also available in: Unified diff