From 14ac6e98507b175a4a905e9c3cef5358d64793ad Mon Sep 17 00:00:00 2001 From: Randy Coulman Date: Thu, 21 Jun 2018 12:11:00 -0700 Subject: [PATCH] Access priority sorter plugin info via short name In [version 2.0](https://github.com/jenkinsci/priority-sorter-plugin/commit/8f2ae302bd98a3e7edd66f75bed6324ab85c57a4) of the priority sorter plugin, the long name of the plugin was renamed to "Jenkins Priority Sorter Plugin", which broke the `priority_sorter` function in the `properties` module. The short name did not change, so we now use that instead to ensure that we generate a configuration that matches the latest required by the plugin. Change-Id: I89a8fdabeac63ea482b3b1bd8ddf2dd83c1c7435 Task: 3112 Story: 2000655 --- jenkins_jobs/modules/properties.py | 2 +- tests/properties/fixtures/priority_sorter002.plugins_info.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins_jobs/modules/properties.py b/jenkins_jobs/modules/properties.py index 3efe1037d..98f1d6455 100644 --- a/jenkins_jobs/modules/properties.py +++ b/jenkins_jobs/modules/properties.py @@ -507,7 +507,7 @@ def priority_sorter(registry, xml_parent, data): /../../tests/properties/fixtures/priority_sorter002.yaml :language: yaml """ - plugin_info = registry.get_plugin_info('Priority Sorter Plugin') + plugin_info = registry.get_plugin_info('PrioritySorter') version = pkg_resources.parse_version(plugin_info.get('version', '0')) if version >= pkg_resources.parse_version("2.0"): diff --git a/tests/properties/fixtures/priority_sorter002.plugins_info.yaml b/tests/properties/fixtures/priority_sorter002.plugins_info.yaml index d4045458e..ce2e9d938 100644 --- a/tests/properties/fixtures/priority_sorter002.plugins_info.yaml +++ b/tests/properties/fixtures/priority_sorter002.plugins_info.yaml @@ -1,3 +1,3 @@ -- longName: 'Priority Sorter Plugin' +- longName: 'Jenkins Priority Sorter Plugin' shortName: 'PrioritySorter' version: '2.0'