diff --git a/jenkins/__init__.py b/jenkins/__init__.py index d9387d2..8674222 100755 --- a/jenkins/__init__.py +++ b/jenkins/__init__.py @@ -1461,7 +1461,7 @@ class Jenkins(object): raise for executor in info['executors']: executable = executor['currentExecutable'] - if executable and 'PlaceholderTask' not in executable.get('_class', ''): + if executable and 'number' in executable: executor_number = executor['number'] build_number = executable['number'] url = executable['url'] diff --git a/tests/test_build.py b/tests/test_build.py index a4ad4c9..afb36bb 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -432,7 +432,7 @@ class JenkinsListRunningBuildsTest(JenkinsTestBase): @patch.object(jenkins.Jenkins, 'get_node_info') @patch.object(jenkins.Jenkins, 'get_nodes') - def test_placeholder_task_in_queue(self, nodes_mock, node_info_mock): + def test_unnumbered_task_in_queue(self, nodes_mock, node_info_mock): nodes_to_return = [{ 'name': "foo-slave", 'offline': False }] @@ -448,13 +448,7 @@ class JenkinsListRunningBuildsTest(JenkinsTestBase): "progress": -1 }, { - 'currentExecutable': { - '_class': ( - 'org.jenkinsci.plugins.workflow.support.steps.' - 'ExecutorStepExecution$PlaceholderTask$' - 'PlaceholderExecutable' - ) - }, + 'currentExecutable': {}, 'currentWorkUnit': {}, 'idle': False, 'likelyStuck': False,