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

b/snf-cyclades-app/synnefo/logic/management/commands/network-remove.py
1
# Copyright 2011-2013 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
......
32 32
from snf_django.management.commands import RemoveCommand
33 33
from snf_django.lib.api import faults
34 34
from synnefo.logic import networks
35
from synnefo.management.common import get_network, convert_api_faults
35
from synnefo.management import common
36 36

  
37 37

  
38 38
class Command(RemoveCommand):
......
40 40
    args = "<Network ID> [<Network ID> ...]"
41 41
    help = "Remove a network from the Database, and Ganeti"
42 42

  
43
    @convert_api_faults
43
    @common.convert_api_faults
44 44
    def handle(self, *args, **options):
45 45
        if not args:
46 46
            raise CommandError("Please provide a network ID")
......
52 52
        for network_id in args:
53 53
            self.stdout.write("\n")
54 54
            try:
55
                network = get_network(network_id, for_update=True)
55
                network = common.get_resource("network", network_id,
56
                                              for_update=True)
56 57
                self.stdout.write('Removing network: %s\n' %
57 58
                                  network.backend_id)
58 59

  

Also available in: Unified diff