From 4cc691d7bbf275798211d08e1bc41672c15ad7d3 Mon Sep 17 00:00:00 2001 From: Bartek Grzybowski Date: Mon, 25 Nov 2019 11:39:03 +0100 Subject: Insert SDNC ip pool automatically only if oom_mode is enabled Change-Id: Ia1fe923f877cf76e51bcc1f23c9bf562a877b112 Signed-off-by: Bartek Grzybowski Issue-ID: TEST-222 --- test/vcpe/config_sdnc_so.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/vcpe/config_sdnc_so.py b/test/vcpe/config_sdnc_so.py index 375c7aaff..9f9a2e007 100755 --- a/test/vcpe/config_sdnc_so.py +++ b/test/vcpe/config_sdnc_so.py @@ -88,14 +88,18 @@ def insert_customer_service_to_so(vcpecommon): vcpecommon.onap_environment) + '\n'.join(cmds) + '"') def insert_sdnc_ip_pool(vcpecommon): - logger = logging.getLogger(__name__) - logger.info('Inserting SDNC ip pool to SDNC DB') - cmds = [] - # Get the VGWs network address - vgw_net = '.'.join(vcpecommon.preload_network_config['mux_gw'][0].split('.')[:3]) - row_values = [] - # Prepare single INSERT statement with all IP values - for ip in range(22,250): - row_values.append("('', 'VGW', 'AVAILABLE','{0}.{1}')".format(vgw_net,ip)) - cmds.append("INSERT IGNORE INTO IPV4_ADDRESS_POOL VALUES" + ', '.join(row_values) + ';') - vcpecommon.execute_cmds_mariadb(cmds) + if vcpecommon.oom_mode: + logger = logging.getLogger(__name__) + logger.info('Inserting SDNC ip pool to SDNC DB') + cmds = [] + # Get the VGWs network address + vgw_net = '.'.join(vcpecommon.preload_network_config['mux_gw'][0].split('.')[:3]) + row_values = [] + # Prepare single INSERT statement with all IP values + for ip in range(22,250): + row_values.append("('', 'VGW', 'AVAILABLE','{0}.{1}')".format(vgw_net,ip)) + cmds.append("INSERT IGNORE INTO IPV4_ADDRESS_POOL VALUES" + ', '.join(row_values) + ';') + vcpecommon.execute_cmds_mariadb(cmds) + else: + # Ip pool should have been inserted manually according to the documentation + pass -- cgit 1.2.3-korg