Update classes to new Galera.groovy class
- remove duplicate line
Related: PROD-27561 (PROD:27561)
Change-Id: I3c5c1ee2ade259cc0fd1971b605c86e829243f60
(cherry picked from commit 208c48710a63c628a174ab89ad38e737da4c6e5a)
diff --git a/cloud-update.groovy b/cloud-update.groovy
index 99c661c..0ea5fea 100644
--- a/cloud-update.groovy
+++ b/cloud-update.groovy
@@ -667,9 +667,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 e65257a..d75e3ea 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
@@ -32,11 +32,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"
@@ -75,7 +75,7 @@
}
try {
if((!askConfirmation && resultCode > 0) || askConfirmation){
- openstack.restoreGaleraDb(pepperEnv)
+ galera.restoreGaleraDb(pepperEnv)
}
} catch (Exception e) {
common.errorMsg("Restoration process has failed.")
@@ -83,7 +83,7 @@
}
stage('Verify restoration result') {
common.retry(verificationRetries, 15) {
- exitCode = openstack.verifyGaleraStatus(pepperEnv, 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 5 seconds.")
} else {