summaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-02-04 13:40:21 +0000
committerGerrit Code Review <gerrit@onap.org>2019-02-04 13:40:21 +0000
commit4e8b17fc758a50fcf7ec62daad9c1ac23857c65a (patch)
treef785221b217cdc210a22b072873e5684257ee200 /adapters/mso-openstack-adapters
parent3f97da710ec3008a625e941609106f40db71b5e8 (diff)
parent35f4a305073fd201e015246081fe60eaffd00fd3 (diff)
Merge "add in a retry function for cloud config migration"
Diffstat (limited to 'adapters/mso-openstack-adapters')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java b/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java
index 257ad3c023..5acd8359ec 100644
--- a/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java
+++ b/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java
@@ -65,7 +65,22 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro
LOGGER.debug("Starting migration for CloudConfig");
CloudConfig cloudConfig = null;
-
+
+ String tableQuery = "SELECT * FROM identity_services";
+ int totalRetries = 20;
+ boolean tableExists = false;
+ int count = 1;
+ while(!tableExists && count != totalRetries) {
+ try(Statement stmt = connection.createStatement();) {
+ stmt.executeQuery(tableQuery);
+ tableExists = true;
+ } catch (SQLException e) {
+ count++;
+ // Wait 5 mintues
+ Thread.sleep(300000);
+ }
+ }
+
// Try the override file
String configLocation = System.getProperty("spring.config.additional-location");
if (configLocation != null) {