Commit d466b050 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Fix creation of networks in new backend

parent ad1b5dc3
......@@ -667,7 +667,9 @@ def create_network_synced(network, backend):
def _create_network_synced(network, backend):
client = backend.client
job = client.CreateNetwork(network.backend_id, network.subnet)
backend_jobs = _create_network(network, [backend])
(_, job) = backend_jobs[0]
return wait_for_job(client, job)
......
......@@ -36,7 +36,8 @@ from django.db.utils import IntegrityError
from synnefo.logic.backend import (get_physical_resources,
update_resources,
create_client,
create_network_synced)
create_network_synced,
connect_network_synced)
from synnefo.util.rapi import GanetiApiError
......@@ -137,3 +138,11 @@ class Command(BaseCommand):
if result[0] != "success":
self.stdout.write('\nError Creating Network %s: %s\n' %\
(net.backend_id, result[1]))
self.stdout.write('Successfully created Network: %s\n' %
net.backend_id)
result = connect_network_synced(network=net, backend=backend)
if result[0] != "success":
self.stdout.write('\nError Connecting Network %s: %s\n' %\
(net.backend_id, result[1]))
self.stdout.write('Successfully connected Network: %s\n' %
net.backend_id)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment