Revert "Fix SMTP configuration"
This reverts commit 70c12fe45c15a699bc83b86c736e8a6dcfca9c7b.
Change-Id: Ida98cf5963696d793295e6e60ad9c933267474ad
diff --git a/_states/jenkins_smtp.py b/_states/jenkins_smtp.py
index b03b3a7..45f0244 100644
--- a/_states/jenkins_smtp.py
+++ b/_states/jenkins_smtp.py
@@ -3,11 +3,12 @@
logger = logging.getLogger(__name__)
set_smtp_groovy = """\
-def result = "FAILED"
+def result = ""
for(desc in [Jenkins.getInstance().getDescriptor("hudson.plugins.emailext.ExtendedEmailPublisher"),Jenkins.getInstance().getDescriptor("hudson.tasks.Mailer")]){
if(desc.getSmtpServer().equals("${host}") &&
- (desc instanceof hudson.tasks.Mailer$DescriptorImpl ? desc.getSmtpAuthUserName() : desc.getSmtpUsername()) == "${username}" &&
- (desc instanceof hudson.tasks.Mailer$DescriptorImpl ? desc.getSmtpAuthPassword() : desc.getSmtpPassword().toString()) == "${password}" &&
+ ((desc instanceof hudson.plugins.emailext.ExtendedEmailPublisherDescriptor && desc.getSmtpAuthUsername().equals("${username}")) ||
+ (desc instanceof hudson.tasks.Mailer$DescriptorImpl && desc.getSmtpAuthUserName().equals("${username}"))) &&
+ desc.getSmtpAuthPassword().toString().equals("${password}") &&
desc.getSmtpPort().equals("${port}") &&
desc.getUseSsl() == ${ssl} &&
desc.getCharset().equals("${charset}") &&