[CVP] Throw an exception if Openstack is not found (cvp-func,perf,ha)
Change-Id: I19d238b0d47797c6c6b53e8f7c8a8d3014ba242d
Related-PROD: PROD-30323
diff --git a/cvp-func.groovy b/cvp-func.groovy
index 0c657a5..31a412b 100644
--- a/cvp-func.groovy
+++ b/cvp-func.groovy
@@ -32,6 +32,10 @@
stage('Initialization') {
sh "rm -rf ${artifacts_dir}"
saltMaster = salt.connection(SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
+ os_version=salt.getPillar(saltMaster, 'I@salt:master', '_param:openstack_version')['return'][0].values()[0]
+ if (!os_version) {
+ throw new Exception("Openstack is not found on this env. Exiting")
+ }
salt.cmdRun(saltMaster, TARGET_NODE, "rm -rf ${remote_artifacts_dir}")
salt.cmdRun(saltMaster, TARGET_NODE, "mkdir -p ${remote_artifacts_dir}")
keystone_creds = validate._get_keystone_creds_v3(saltMaster)