summaryrefslogtreecommitdiffstats
path: root/deploy/tempest.py
diff options
context:
space:
mode:
authorzhouya <zhou.ya@zte.com.cn>2017-06-20 17:31:38 +0800
committerroot <zhou.ya@zte.com.cn>2017-06-24 14:34:18 +0800
commit9b684b23b8377acbbf0cf7975375381831d84cf8 (patch)
treeb9874edbcee4b2a15fcf0e16151f623e50328716 /deploy/tempest.py
parent7795fc14f129a2c37607aa965d63e5831099681b (diff)
enable opendaylight
Change-Id: I759d864efa524c0d564b9d93aa480e155149adaa Signed-off-by: zhouya <zhou.ya@zte.com.cn>
Diffstat (limited to 'deploy/tempest.py')
-rw-r--r--deploy/tempest.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/deploy/tempest.py b/deploy/tempest.py
index 4f75ee77..b1e02763 100644
--- a/deploy/tempest.py
+++ b/deploy/tempest.py
@@ -35,6 +35,8 @@ _CLI_OPTS = [
help='install daisy'),
cfg.IntOpt('isbare',
help='deploy environment'),
+ cfg.StrOpt('scenario',
+ help='deploy scenario'),
]
@@ -100,6 +102,10 @@ def prepare_install():
protocol_type = None
enable_cinder_backend(cluster_id, service_name,
ceph_disk_name, protocol_type)
+ if 'scenario' in conf and 'odl_l3' in conf['scenario']:
+ enable_opendaylight(cluster_id, 'odl_l3')
+ elif 'scenario' in conf and 'odl_l2' in conf['scenario']:
+ enable_opendaylight(cluster_id, 'odl_l2')
if 'isbare' in conf and conf['isbare'] == 0:
install_os_for_vm_step1(cluster_id)
else:
@@ -240,5 +246,29 @@ def enable_cinder_backend(cluster_id, service_name, disk_name, protocol_type):
print e
+def enable_opendaylight(cluster_id, layer):
+ role_meta = {'filters': {'cluster_id': cluster_id}}
+ role_list_generator = client.roles.list(**role_meta)
+ lb_role_id = [role.id for role in role_list_generator if
+ role.name == "CONTROLLER_LB"][0]
+ odl_layer = 'l3'
+ if 'odl_l3' == layer:
+ odl_layer = 'l3'
+ elif 'odl_l2' == layer:
+ odl_layer = 'l2'
+ neutron_backend_info = {
+ 'neutron_backends_array': [{'zenic_ip': '',
+ 'sdn_controller_type': 'opendaylight',
+ 'zenic_port': '',
+ 'zenic_user_password': '',
+ 'neutron_agent_type': '',
+ 'zenic_user_name': '',
+ 'enable_l2_or_l3': odl_layer}]}
+ try:
+ client.roles.update(lb_role_id, **neutron_backend_info)
+ except Exception as e:
+ print e
+
+
if __name__ == "__main__":
prepare_install()