Merge "Refactor Backupninja restore pipeline to support Dogtag"
diff --git a/backupninja-backup-pipeline.groovy b/backupninja-backup-pipeline.groovy
index 5ec3457..1af5e5b 100644
--- a/backupninja-backup-pipeline.groovy
+++ b/backupninja-backup-pipeline.groovy
@@ -11,6 +11,7 @@
 logBackupFailure = []
 
 def checkBackupninjaLog(output, backupName='', terminateOnFailure=true) {
+    def common = new com.mirantis.mk.Common()
     def outputPattern = java.util.regex.Pattern.compile("\\d+")
     def outputMatcher = outputPattern.matcher(output)
     if (outputMatcher.find()) {
@@ -61,7 +62,7 @@
             if (backupDogtag) {
                 try {
                     def dogtagPillar = salt.getPillar(pepperEnv, "I@salt:master", "dogtag:server")
-                    if (masterPillar['return'].isEmpty()) {
+                    if (dogtagPillar['return'].isEmpty()) {
                         throw new Exception("Problem with dogtag pillar on I@dogtag:server node.")
                     }
                 }
diff --git a/update-package.groovy b/update-package.groovy
index 851c376..14c2056 100644
--- a/update-package.groovy
+++ b/update-package.groovy
@@ -54,10 +54,14 @@
                 common.infoMsg("Listing all the packages that have a new update available on nodes: ${targetLiveAll}")
                 salt.runSaltProcessStep(pepperEnv, targetLiveAll, 'pkg.list_upgrades', [], batch_size, true)
                 if (TARGET_PACKAGES != '' && TARGET_PACKAGES != '*') {
-                    common.warningMsg("Note that only the \"${TARGET_PACKAGES}\" would be installed from the above list of available updates on the ${targetLiveAll}")
+                    if (ALLOW_DEPENDENCY_UPDATE.toBoolean()) {
+                        common.warningMsg("Note that the \"${TARGET_PACKAGES}\" and it new dependencies would be installed from the above list of available updates on the ${targetLiveAll}")
+                    } else {
+                        common.warningMsg("Note that only the \"${TARGET_PACKAGES}\" would be installed from the above list of available updates on the ${targetLiveAll}")
+                        commandKwargs = ['only_upgrade': 'true']
+                    }
                     command = "pkg.install"
                     packages = TARGET_PACKAGES.tokenize(' ')
-                    commandKwargs = ['only_upgrade': 'true']
                 }
             }