Revision 3524241a snf-cyclades-app/synnefo/logic/management/commands/backend-add.py

b/snf-cyclades-app/synnefo/logic/management/commands/backend-add.py
31 31
from optparse import make_option
32 32
from django.core.management.base import BaseCommand, CommandError
33 33

  
34
from synnefo.db.models import Backend, Network, BackendNetwork
34
from synnefo.db.models import Backend, Network
35 35
from django.db.utils import IntegrityError
36 36
from synnefo.logic.backend import (get_physical_resources,
37 37
                                   update_resources,
38
                                   create_client,
39 38
                                   create_network_synced,
40 39
                                   connect_network_synced)
41
from synnefo.util.rapi import GanetiApiError
40
from synnefo.logic.rapi import GanetiApiError, GanetiRapiClient
42 41

  
43 42

  
44 43
class Command(BaseCommand):
......
77 76
        if options['check']:
78 77
            self.stdout.write('Checking connectivity and credentials.\n')
79 78
            try:
80
                client = create_client(clustername, port, username, password)
79
                client = GanetiRapiClient(clustername, port, username, password)
81 80
                # This command will raise an exception if there is no
82 81
                # write-access
83 82
                client.ModifyCluster()
......
127 126
        self.stdout.write(line + '\n')
128 127
        self.stdout.write(sep + '\n')
129 128

  
130

  
131 129
        for net in networks:
132 130
            fields = (net.backend_id, str(net.subnet), str(net.gateway),
133 131
                      str(net.mac_prefix), str(net.public))

Also available in: Unified diff