From 79e9d96d14229cd3a4a33d25dd8e70581d6d1eaf Mon Sep 17 00:00:00 2001 From: Evgeniy L Date: Thu, 23 Apr 2015 17:12:41 +0300 Subject: [PATCH] Implemented node based scope --- examples/nodes_list.yaml | 2 ++ examples/resources/keystone.yml | 2 +- solar/solar/extensions/modules/discovery.py | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/nodes_list.yaml b/examples/nodes_list.yaml index d25ecc4e..7b7d9da8 100644 --- a/examples/nodes_list.yaml +++ b/examples/nodes_list.yaml @@ -7,3 +7,5 @@ ip: 10.0.0.3 ssh_user: vagrant ssh_private_key_path: /vagrant/tmp/keys/ssh_private + attrs: + keystone_admin_port: 77777 diff --git a/examples/resources/keystone.yml b/examples/resources/keystone.yml index d7a6eeaf..74cf3c2c 100644 --- a/examples/resources/keystone.yml +++ b/examples/resources/keystone.yml @@ -15,7 +15,7 @@ input: db_host: first_with_tags: ["entrypoint/mariadb"] item: '{{ item.node.ip }}' - admin_port: 35357 + admin_port: '{{ this.node.keystone_admin_port|d(35357) }}' public_port: 5000 name: solar.keystone-test image: kollaglue/centos-rdo-keystone diff --git a/solar/solar/extensions/modules/discovery.py b/solar/solar/extensions/modules/discovery.py index fe91765c..21765f18 100644 --- a/solar/solar/extensions/modules/discovery.py +++ b/solar/solar/extensions/modules/discovery.py @@ -1,3 +1,4 @@ +import copy import io import os @@ -38,7 +39,7 @@ class Discovery(base.BaseExtension): nodes_resources = [] for node in nodes_list: - node_resource = {} + node_resource = copy.deepcopy(node.get('attrs', {})) node_resource['id'] = node['id'] node_resource['name'] = node['id'] node_resource['handler'] = 'data'