diff --git a/lib/ansible/modules/web_infrastructure/jenkins_job.py b/lib/ansible/modules/web_infrastructure/jenkins_job.py index 325be38d8c9..a9a56cedfba 100644 --- a/lib/ansible/modules/web_infrastructure/jenkins_job.py +++ b/lib/ansible/modules/web_infrastructure/jenkins_job.py @@ -190,9 +190,6 @@ class JenkinsJob: } } - # This kind of jobs do not have a property that makes them enabled/disabled - self.job_classes_exceptions = ["jenkins.branch.OrganizationFolder","com.cloudbees.hudson.plugins.folder.Folder"] - self.EXCL_STATE = "excluded state" def get_jenkins_connection(self): @@ -208,14 +205,10 @@ class JenkinsJob: except Exception as e: self.module.fail_json(msg='Unable to connect to Jenkins server, %s' % to_native(e), exception=traceback.format_exc()) - def job_class_excluded(self, check_class): - return check_class in self.job_classes_exceptions - def get_job_status(self): try: - check_class = ET.fromstring(self.get_current_config()).tag response = self.server.get_job_info(self.name) - if self.job_class_excluded(check_class): + if "color" not in response: return self.EXCL_STATE else: return response['color'].encode('utf-8')