Fix issues in pipeline for backupninja backup
Change-Id: I8d62e77afdc2df8da016ba8ad56f6c7e4d2db446
Related-Prod: PROD-31827
(cherry picked from commit 7c06606d13034aea8e47f633fb17c1cb4ea38453)
diff --git a/backupninja-backup-pipeline.groovy b/backupninja-backup-pipeline.groovy
index f6eaae2..58254f3 100644
--- a/backupninja-backup-pipeline.groovy
+++ b/backupninja-backup-pipeline.groovy
@@ -2,6 +2,7 @@
def salt = new com.mirantis.mk.Salt()
def python = new com.mirantis.mk.Python()
def pepperEnv = "pepperEnv"
+def askConfirmation = (env.getProperty('ASK_CONFIRMATION') ?: true).toBoolean()
timeout(time: 12, unit: 'HOURS') {
node() {
@@ -39,7 +40,7 @@
return
}
- def postgresqlMajorVersion = salt.getPillar(venvPepper, 'I@salt:master', '_param:postgresql_major_version').get('return')[0].values()[0]
+ def postgresqlMajorVersion = salt.getPillar(pepperEnv, 'I@salt:master', '_param:postgresql_major_version').get('return')[0].values()[0]
if (! postgresqlMajorVersion) {
input message: "Can't get _param:postgresql_major_version parameter, which is required to determine postgresql-client version. Is it defined in pillar? Confirm to proceed anyway."
} else {
@@ -47,13 +48,13 @@
try {
if (!salt.isPackageInstalled(['saltId': pepperEnv, 'target': backupNode, 'packageName': postgresqlClientPackage, 'output': false])) {
if (askConfirmation) {
- input message: "Do you want to install ${postgresqlClientPackages} package on targeted nodes: ${backupNode}? It's required to make backup. Click to confirm"
+ input message: "Do you want to install ${postgresqlClientPackage} package on targeted nodes: ${backupNode}? It's required to make backup. Click to confirm"
}
// update also common fake package
salt.runSaltProcessStep(pepperEnv, backupNode, 'pkg.install', ["postgresql-client,${postgresqlClientPackage}"])
}
} catch (Exception e) {
- common.errorMsg("Unable to determine status of ${postgresqlClientPackages} packages on target nodes: ${backupNode}.")
+ common.errorMsg("Unable to determine status of ${postgresqlClientPackage} packages on target nodes: ${backupNode}.")
if (askConfirmation) {
input message: "Do you want to continue? Click to confirm"
}