From 02f23b6d73881c416054b4eccd4994f08af112cd Mon Sep 17 00:00:00 2001 From: Andrey Pavlov Date: Wed, 26 Oct 2016 17:12:02 +0000 Subject: [PATCH] Ports configuration refactoring Ports configuration has been changed: before: port: 123:3333 after: port: cont: 123 node: 3333 Change-Id: I8e48203704856778881ab5ef0a31142765b8365b Depends-On: I54ab8dd02fc88b821a1f0d05c08f98b618730150 --- fuel_ccp_entrypoint/start_script.py | 7 ++++--- fuel_ccp_entrypoint/tests/test_fuel_ccp_entrypoint.py | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/fuel_ccp_entrypoint/start_script.py b/fuel_ccp_entrypoint/start_script.py index d9d5808..f5c3fb2 100644 --- a/fuel_ccp_entrypoint/start_script.py +++ b/fuel_ccp_entrypoint/start_script.py @@ -1,5 +1,6 @@ #!/usr/bin/env python + import argparse import functools import logging @@ -171,7 +172,7 @@ def openstackclient_preexec_fn(): os.environ["OS_USERNAME"] = VARIABLES['openstack']['user_name'] os.environ["OS_PROJECT_NAME"] = VARIABLES['openstack']['project_name'] os.environ["OS_AUTH_URL"] = 'http://%s:%s/v3' % ( - address('keystone'), VARIABLES['keystone']['admin_port']) + address('keystone'), VARIABLES['keystone']['admin_port']['cont']) return result @@ -254,10 +255,10 @@ def get_etcd_client(): if VARIABLES["role_name"] == "etcd": etcd_machines.append( (VARIABLES["network_topology"]["private"]["address"], - VARIABLES["etcd"]["client_port"])) + VARIABLES["etcd"]["client_port"]['cont'])) else: etcd_machines.append( - (address('etcd'), VARIABLES["etcd"]["client_port"]) + (address('etcd'), VARIABLES["etcd"]["client_port"]['cont']) ) etcd_machines_str = " ".join(["%s:%d" % (h, p) for h, p in etcd_machines]) diff --git a/fuel_ccp_entrypoint/tests/test_fuel_ccp_entrypoint.py b/fuel_ccp_entrypoint/tests/test_fuel_ccp_entrypoint.py index a18185f..03b72c3 100644 --- a/fuel_ccp_entrypoint/tests/test_fuel_ccp_entrypoint.py +++ b/fuel_ccp_entrypoint/tests/test_fuel_ccp_entrypoint.py @@ -129,7 +129,9 @@ class TestGetETCDClient(base.TestCase): start_script.VARIABLES = { "role_name": "etcd", "etcd": { - "client_port": 10042, + "client_port": { + "cont": 10042 + }, "connection_attempts": 3, "connection_delay": 0, }, @@ -154,7 +156,9 @@ class TestGetETCDClient(base.TestCase): "role_name": "banana", "namespace": "ccp", "etcd": { - "client_port": 1234, + "client_port": { + "cont": 1234 + }, "connection_attempts": 3, "connection_delay": 0, },