Set batch size by default to 2/3 of available worker_threads

If no batch size specified in job parameters set it to 2/3 of available
worker_threads for Salt Master.

Related-Prod: PROD-34417
Change-Id: Ie2dcbcc070214f032c5e31d82f2ddcdea73cbcd4
diff --git a/cloud-deploy-pipeline.groovy b/cloud-deploy-pipeline.groovy
index bfed52d..e8776bb 100644
--- a/cloud-deploy-pipeline.groovy
+++ b/cloud-deploy-pipeline.groovy
@@ -356,7 +356,11 @@
             // Install
             //
             if (!batch_size) {
-                batch_size = salt.getWorkerThreads(venvPepper)
+                // if no batch size provided get current worker threads and set batch size to 2/3 of it to avoid
+                // 'SaltReqTimeoutError: Message timed out' issue on Salt targets for large amount of nodes
+                // do not use toDouble/Double as it requires additional approved method
+                def workerThreads = salt.getWorkerThreads(venvPepper).toInteger()
+                batch_size = (workerThreads * 2 / 3).toString().tokenize('.')[0]
             }
 
             // Check if all minions are reachable and ready