fix-env-vars-on-model-testing

Change-Id: I027aedb9f4cb62e4567428509e972256c3d35e21
diff --git a/src/com/mirantis/mk/SaltModelTesting.groovy b/src/com/mirantis/mk/SaltModelTesting.groovy
index 4f1c60e..16de7bc 100644
--- a/src/com/mirantis/mk/SaltModelTesting.groovy
+++ b/src/com/mirantis/mk/SaltModelTesting.groovy
@@ -49,15 +49,15 @@
     }
     sh("mkdir -p /srv/salt/scripts/ || true")
     sh("cp -r ${testDir} /srv/salt/reclass")
-    sh("curl https://raw.githubusercontent.com/salt-formulas/salt-formulas-scripts/master/bootstrap.sh -o /srv/salt/scripts/bootstrap.sh")
     sh("git config --global user.email || git config --global user.email 'ci@ci.local'")
     sh("git config --global user.name || git config --global user.name 'CI'")
+    sh("git clone https://raw.githubusercontent.com/salt-formulas/salt-formulas-scripts -o /srv/salt/scripts")
 
     withEnv(["FORMULAS_SOURCE=${formulasSource}", "EXTRA_FORMULAS=${extraFormulas}", "DISTRIB_REVISION=${formulasRevision}", "DEBUG=1", "MASTER_HOSTNAME=${masterName}", "MINION_ID=${masterName}", "HOSTNAME=cfg01", "DOMAIN=mk-ci.local"]){
         sh("bash -c 'echo $MASTER_HOSTNAME'")
-        sh("bash -c 'source /srv/salt/scripts/bootstrap.sh; cd /srv/salt/scripts && system_config_master'")
-        sh("bash -c 'source /srv/salt/scripts/bootstrap.sh; cd /srv/salt/scripts && saltmaster_bootstrap'")
-        sh("bash -c 'source /srv/salt/scripts/bootstrap.sh; cd /srv/salt/scripts && saltmaster_init'")
+        sh("bash -c 'source /srv/salt/scripts/bootstrap.sh; cd /srv/salt/scripts && source_local_envs && system_config_master'")
+        sh("bash -c 'source /srv/salt/scripts/bootstrap.sh; cd /srv/salt/scripts && source_local_envs && saltmaster_bootstrap'")
+        sh("bash -c 'source /srv/salt/scripts/bootstrap.sh; cd /srv/salt/scripts && source_local_envs && saltmaster_init'")
 
         if (!is_mk_ci) {
            sh("bash -c 'source /srv/salt/scripts/bootstrap.sh; cd /srv/salt/scripts && verify_salt_minions'")