Ports configuration refactoring

Ports configuration has been changed:

before:

  port: 123:3333

after:

  port:
    cont: 123
    node: 3333

Change-Id: I8e48203704856778881ab5ef0a31142765b8365b
Depends-On: I54ab8dd02fc88b821a1f0d05c08f98b618730150
This commit is contained in:
Andrey Pavlov 2016-10-26 17:12:02 +00:00
parent 53b34cccd9
commit 02f23b6d73
2 changed files with 10 additions and 5 deletions

View File

@ -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])

View File

@ -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,
},