Commit 77f75a60 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Revert "cyclades: Speed up reconciliation"

This reverts commit cf2241c45a22dac71e31dbf32f4700c475804c12.
parent c4036bdb
......@@ -78,7 +78,7 @@ INSTALL_REQUIRES = [
'astakosclient',
'snf-django-lib',
'snf-branding',
'snf-webproject',
'snf-webproject'
]
EXTRAS_REQUIRES = {
......
......@@ -32,8 +32,6 @@
# or implied, of GRNET S.A.
import json
import multiprocessing
import itertools
from django.conf import settings
from django.db import transaction
......@@ -643,25 +641,13 @@ def set_firewall_profile(vm, profile):
os_name=os_name)
def get_instances(backend, bulk, queue):
with pooled_rapi_client(backend) as client:
instances = client.GetInstances(bulk=bulk)
queue.put(instances)
def get_ganeti_instances(backend=None, bulk=False):
instances = []
backends = get_backends(backend)
queue = multiprocessing.Queue()
processes = []
for backend in backends:
p = multiprocessing.Process(target=get_instances,
args=(backend, bulk, queue))
processes.append(p)
p.start()
[p.join() for p in processes]
[instances.extend(queue.get()) for p in processes]
return instances
for backend in get_backends(backend):
with pooled_rapi_client(backend) as client:
instances.append(client.GetInstances(bulk=bulk))
return reduce(list.__add__, instances, [])
def get_ganeti_nodes(backend=None, bulk=False):
......
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