From fa03f073802bbf0cfaaef4d0477adc4480f40c9f Mon Sep 17 00:00:00 2001 From: Dmitry Shulyak Date: Wed, 11 Nov 2015 19:01:38 +0200 Subject: [PATCH] Add proper client for nailgun in fsclient.py --- docker-compose.yml | 6 ++++++ f2s/fsclient.py | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 23135752..61f5b467 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,12 @@ solar: links: - riak - redis + +# docker run --name solar -d -v /root/solar/solar:/solar -v /root/solar/solard:/solard -v /root/solar/templates:/vagrant/templates \ +# -v /root/solar/resources:/vagrant/resources -v /root/solar/f2s:/vagrant/f2s \ +# -v /var/lib/fuel:/var/lib/fuel -v /root/.config/fuel/fuel_client.yaml:/root/.config/fuel/fuel_client.yaml \ +# --link=riak:riak --link=redis:redis --name solar solarproject/solar-celery:f2s + riak: image: tutum/riak ports: diff --git a/f2s/fsclient.py b/f2s/fsclient.py index a59658be..63fe8b2f 100755 --- a/f2s/fsclient.py +++ b/f2s/fsclient.py @@ -15,13 +15,15 @@ class NailgunSource(object): def nodes(self, uids): from fuelclient.objects.node import Node nodes_obj = map(Node, nodes) - return [] + return [str(n.data['id']), str(n.data['ip']), str(n.data['cluster'])] - def roles(self, roles): - return [] + def roles(self, uid): + from fuelclient.objects.node import Node + node = Node(uid) + return node.data['roles'] + node.data['pending_roles'] def master(self): - return 'master', '' + return 'master', '10.20.0.2' class DumbSource(object):