Fixed jenkins smtp and admin email enforcing
Change-Id: I70ed40ccc0a5f9676afa57b3e2b8301b3e739ecc
diff --git a/_states/jenkins_smtp.py b/_states/jenkins_smtp.py
index 87377e9..98bbd6d 100644
--- a/_states/jenkins_smtp.py
+++ b/_states/jenkins_smtp.py
@@ -14,8 +14,12 @@
result = "EXISTS"
}}else{{
desc.setSmtpAuth("{username}", "{password}")
- desc.setSmtpHost("{host}")
desc.setUseSsl({ssl})
+ if(desc instanceof hudson.plugins.emailext.ExtendedEmailPublisherDescriptor){{
+ desc.setSmtpServer("{host}")
+ }}else{{
+ desc.setSmtpHost("{host}")
+ }}
desc.setSmtpPort("{port}")
desc.setCharset("{charset}")
if({reply_to_exists}){{
@@ -110,7 +114,7 @@
ret['comment'] = 'Jenkins admin email config %s %s' % (name, status.lower())
else:
call_result = __salt__['jenkins_common.call_groovy_script'](
- set_smtp_groovy, {"email": email})
+ set_admin_email_groovy, {"email": email})
if call_result["code"] == 200 and call_result["msg"] in ["SUCCESS", "EXISTS"]:
status = call_result["msg"]
if status == "SUCCESS":