Revision e41977e2
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 |
|
34 |
from synnefo.db.models import Backend, Network, BackendNetwork
|
|
35 | 35 |
from django.db.utils import IntegrityError |
36 | 36 |
from synnefo.logic.backend import (get_physical_resources, |
37 | 37 |
update_resources, |
... | ... | |
65 | 65 |
def handle(self, **options): |
66 | 66 |
clustername = options['clustername'] |
67 | 67 |
port = options['port'] |
68 |
username = options['user'] |
|
69 |
password = options['pass'] |
|
68 |
username = options['username']
|
|
69 |
password = options['password']
|
|
70 | 70 |
drained = options['drained'] |
71 | 71 |
|
72 | 72 |
if not (clustername and username and password): |
... | ... | |
132 | 132 |
self.stdout.write(sep + '\n\n') |
133 | 133 |
|
134 | 134 |
for net in networks: |
135 |
BackendNetwork.objects.create(network=net, backend=backend) |
|
135 | 136 |
result = create_network_synced(net, backend) |
136 | 137 |
if result[0] != "success": |
137 | 138 |
self.stdout.write('\nError Creating Network %s: %s\n' %\ |
138 |
(net.backend_id, result[1]) |
|
139 |
(net.backend_id, result[1])) |
b/snf-cyclades-app/synnefo/logic/management/commands/network_inspect.py | ||
---|---|---|
56 | 56 |
raise CommandError("Network not found in DB.") |
57 | 57 |
|
58 | 58 |
sep = '-' * 80 + '\n' |
59 |
labels = ('name', 'owner', 'subnet', 'gateway', 'max_prefix', 'link', |
|
59 |
labels = ('name', 'backend-name', 'owner', 'subnet', 'gateway', 'max_prefix', 'link',
|
|
60 | 60 |
'public', 'dhcp', 'type', 'deleted', 'action') |
61 |
fields = (net.name, str(net.userid), str(net.subnet), str(net.gateway), |
|
61 |
fields = (net.name, net.backend_id, str(net.userid), str(net.subnet), str(net.gateway),
|
|
62 | 62 |
str(net.mac_prefix), str(net.link), str(net.public), str(net.dhcp), |
63 | 63 |
str(net.type), str(net.deleted), str(net.action)) |
64 | 64 |
|
Also available in: Unified diff