diff options
author | Anil Belur <askb23@gmail.com> | 2018-03-11 21:01:37 +1000 |
---|---|---|
committer | Sorin Sbarnea <ssbarnea@redhat.com> | 2018-04-18 23:32:25 +0100 |
commit | f4b66dc531c852cabaacdb7443fa07003fc3e03f (patch) | |
tree | 57c73eff3cd8c1c020d81417fa25cda892153218 /jenkins_jobs/modules/view_list.py | |
parent | bd07732cc787a6ac2bd8abd6c22fb5704314af36 (diff) | |
download | python-jenkins-job-builder-f4b66dc531c852cabaacdb7443fa07003fc3e03f.tar.gz python-jenkins-job-builder-f4b66dc531c852cabaacdb7443fa07003fc3e03f.tar.xz python-jenkins-job-builder-f4b66dc531c852cabaacdb7443fa07003fc3e03f.zip |
Add support for secured jobs filter
Add support for secured jobs filter for views.
Change-Id: I8b64d80eb0a6131c188710874c5406a1013e44e6
Signed-off-by: Anil Belur <askb23@gmail.com>
Diffstat (limited to 'jenkins_jobs/modules/view_list.py')
-rw-r--r-- | jenkins_jobs/modules/view_list.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/jenkins_jobs/modules/view_list.py b/jenkins_jobs/modules/view_list.py index ddfe23c2..3fa11d58 100644 --- a/jenkins_jobs/modules/view_list.py +++ b/jenkins_jobs/modules/view_list.py @@ -169,6 +169,11 @@ to the :ref:`view_list` definition. * **scm-type** ('str'): Type of SCM. (default hudson.scm.NullSCM) + * **secured-job** (`dict`) + :secured-job: + * **match-type** ('str'): Jobs that match a filter + to include. (default includeMatched) + * **columns** (`list`): List of columns to be shown in view. * **regex** (`str`): . Regular expression for selecting jobs (optional) @@ -434,6 +439,18 @@ class List(jenkins_jobs.modules.base.Base): convert_mapping_to_xml(st_xml, st_data, mapping, fail_required=True) + if jobfilter == 'secured-job': + sj_xml = XML.SubElement(job_filter_xml, + 'hudson.views.SecuredJobsFilter') + sj_xml.set('plugin', 'view-job-filters') + sj_data = jobfilters.get('secured-job') + mapping = [ + ('match-type', 'includeExcludeTypeString', + 'includeMatched'), + ] + convert_mapping_to_xml(sj_xml, sj_data, mapping, + fail_required=True) + c_xml = XML.SubElement(root, 'columns') columns = data.get('columns', DEFAULT_COLUMNS) |