From ab9b1d5c42336356cfa40e44503c34f8d0e1f251 Mon Sep 17 00:00:00 2001 From: Bartek Grzybowski Date: Thu, 24 Oct 2019 12:49:04 +0200 Subject: Make SDNC ip pool insertion idempotent This ensures that subsequent 'vcpe.py init' invocations do not complain about duplicate entry in sdnctl databse (entries are not reinserted, INSERT statement is just noop in this case). Change-Id: I8def8eab1e04026e8ee2206aa11fe2644b35d609 Issue-ID: TEST-222 Signed-off-by: Bartek Grzybowski --- test/vcpe/config_sdnc_so.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/vcpe/config_sdnc_so.py b/test/vcpe/config_sdnc_so.py index 13ac47bee..b19c93acf 100755 --- a/test/vcpe/config_sdnc_so.py +++ b/test/vcpe/config_sdnc_so.py @@ -92,5 +92,5 @@ def insert_sdnc_ip_pool(vcpecommon): # 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 INTO IPV4_ADDRESS_POOL VALUES" + ', '.join(row_values) + ';') + cmds.append("INSERT IGNORE INTO IPV4_ADDRESS_POOL VALUES" + ', '.join(row_values) + ';') vcpecommon.execute_cmds_mariadb(cmds) -- cgit 1.2.3-korg