Revision c34b2908

b/snf-cyclades-app/synnefo/api/management/commands/network-create.py
37 37
from synnefo.management.common import validate_network_info, get_backend
38 38
from synnefo.webproject.management.utils import pprint_table
39 39

  
40
from synnefo import quotas
40 41
from synnefo.db.models import Network
41 42
from synnefo.logic.backend import create_network
42 43
from synnefo.api.util import values_from_flavor
......
200 201
            return
201 202

  
202 203
        network = Network.objects.create(**netinfo)
204
        if userid:
205
            quotas.issue_and_accept_commission(network)
203 206

  
204 207
        if public:
205 208
            # Create BackendNetwork only to the specified Backend
b/snf-cyclades-app/synnefo/api/management/commands/network-remove.py
31 31
from django.core.management.base import BaseCommand, CommandError
32 32
from synnefo.logic.backend import delete_network
33 33
from synnefo.management.common import get_network
34
from synnefo import quotas
34 35

  
35 36

  
36 37
class Command(BaseCommand):
......
54 55

  
55 56
        network.action = 'DESTROY'
56 57
        network.save()
58
        quotas.issue_and_accept_commission(network, delete=True)
57 59
        delete_network(network)
58 60

  
59 61
        self.stdout.write('Successfully removed network.\n')
b/snf-cyclades-app/synnefo/api/management/commands/server-create.py
43 43
from synnefo.logic.backend_allocator import BackendAllocator
44 44
from synnefo.api import util
45 45
from synnefo.api.servers import server_created
46
from synnefo import quotas
46 47

  
47 48
HELP_MSG = """
48 49

  
......
156 157
                'img_personality': '[]',
157 158
                'img_properties': json.dumps(image['metadata']),
158 159
            })
160

  
161
            quotas.issue_and_accept_commission(vm)
159 162
        except:
160 163
            transaction.rollback()
161 164
            raise
b/snf-cyclades-app/synnefo/api/management/commands/server-import.py
41 41
from synnefo.logic.backend import wait_for_job
42 42
from synnefo.logic.rapi import GanetiApiError
43 43
from synnefo.api.util import allocate_public_address
44
from synnefo import quotas
44 45

  
45 46
import sys
46 47

  
......
165 166
                                       imageid=image_id,
166 167
                                       flavor=flavor)
167 168

  
169
    quotas.issue_and_accept_commission(vm)
168 170
    # Rename instance
169 171
    rename_instance(instance_name, vm.backend_vm_id, backend_client,
170 172
                    stream)

Also available in: Unified diff