Update classes to new Galera.groovy class
- remove duplicate line
Related: PROD-27561 (PROD:27561)
Change-Id: I681ac9393146490e7988137fedee8394d77f9e73
diff --git a/cloud-update.groovy b/cloud-update.groovy
index 3fd7723..28c5005 100644
--- a/cloud-update.groovy
+++ b/cloud-update.groovy
@@ -658,9 +658,8 @@
def restoreGalera(pepperEnv) {
def salt = new com.mirantis.mk.Salt()
def common = new com.mirantis.mk.Common()
- def openstack = new com.mirantis.mk.Openstack()
- salt.cmdRun(pepperEnv, 'I@xtrabackup:client', "rm -rf /var/lib/mysql/*")
- openstack.restoreGaleraDb(pepperEnv)
+ def galera = new com.mirantis.mk.Galera()
+ galera.restoreGaleraDb(pepperEnv)
}
def backupZookeeper(pepperEnv) {
diff --git a/galera-cluster-verify-restore.groovy b/galera-cluster-verify-restore.groovy
index a5d4483..7a908cb 100644
--- a/galera-cluster-verify-restore.groovy
+++ b/galera-cluster-verify-restore.groovy
@@ -12,7 +12,7 @@
def common = new com.mirantis.mk.Common()
def salt = new com.mirantis.mk.Salt()
-def openstack = new com.mirantis.mk.Openstack()
+def galera = new com.mirantis.mk.Galera()
def python = new com.mirantis.mk.Python()
def pepperEnv = "pepperEnv"
def resultCode = 99
@@ -31,11 +31,11 @@
python.setupPepperVirtualenv(pepperEnv, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
}
stage('Verify status')
- resultCode = openstack.verifyGaleraStatus(pepperEnv, false, checkTimeSync)
+ resultCode = galera.verifyGaleraStatus(pepperEnv, false, checkTimeSync)
stage('Restore') {
if (resultCode == 128) {
common.errorMsg("Unable to connect to Galera Master. Trying slaves...")
- resultCode = openstack.verifyGaleraStatus(pepperEnv, true, checkTimeSync)
+ resultCode = galera.verifyGaleraStatus(pepperEnv, true, checkTimeSync)
if (resultCode == 129) {
common.errorMsg("Unable to obtain Galera slave minions list". "Without fixing this issue, pipeline cannot continue in verification and restoration.")
currentBuild.result = "FAILURE"
@@ -74,7 +74,7 @@
}
try {
if((!askConfirmation && resultCode > 0) || askConfirmation){
- openstack.restoreGaleraDb(pepperEnv)
+ galera.restoreGaleraDb(pepperEnv)
}
} catch (Exception e) {
common.errorMsg("Restoration process has failed.")
@@ -82,7 +82,7 @@
}
stage('Verify restoration result') {
common.retry(verificationRetries, 15) {
- exitCode = openstack.verifyGaleraStatus(pepperEnv, false, false)
+ exitCode = galera.verifyGaleraStatus(pepperEnv, false, false)
if (exitCode >= 1) {
error("Verification attempt finished with an error. This may be caused by cluster not having enough time to come up or to sync. Next verification attempt in 15 seconds.")
} else {