From 1709ba73c8c0493c813cdf1c8892be7caf0bdb78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norbert=20Gr=C3=BCnwald?= Date: Wed, 10 Oct 2018 14:47:52 +0200 Subject: [PATCH] Add support for the "Disk Usage" plugin This adds support for the "Disk Usage" plugin to the properties module. Change-Id: Icead10ae6e4e2e637dddd542128779bf5579d293 --- jenkins_jobs/modules/properties.py | 15 +++++++++++++++ tests/properties/fixtures/disk-usage.xml | 6 ++++++ tests/properties/fixtures/disk-usage.yaml | 2 ++ 3 files changed, 23 insertions(+) create mode 100644 tests/properties/fixtures/disk-usage.xml create mode 100644 tests/properties/fixtures/disk-usage.yaml diff --git a/jenkins_jobs/modules/properties.py b/jenkins_jobs/modules/properties.py index 61ada1afd..9565aa220 100644 --- a/jenkins_jobs/modules/properties.py +++ b/jenkins_jobs/modules/properties.py @@ -206,6 +206,21 @@ def gitlab(registry, xml_parent, data): helpers.convert_mapping_to_xml(gitlab, data, mapping, fail_required=True) +def disk_usage(registry, xml_parent, data): + """yaml: disk-usage + Enables the Disk Usage Plugin. + Requires the Jenkins :jenkins-wiki:`Disk Usage Plugin `. + + Example: + + .. literalinclude:: /../../tests/properties/fixtures/disk-usage.yaml + :language: yaml + """ + XML.SubElement(xml_parent, + 'hudson.plugins.disk__usage.' + 'DiskUsageProperty') + + def least_load(registry, xml_parent, data): """yaml: least-load Enables the Least Load Plugin. diff --git a/tests/properties/fixtures/disk-usage.xml b/tests/properties/fixtures/disk-usage.xml new file mode 100644 index 000000000..0779afa8a --- /dev/null +++ b/tests/properties/fixtures/disk-usage.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/properties/fixtures/disk-usage.yaml b/tests/properties/fixtures/disk-usage.yaml new file mode 100644 index 000000000..d102b4884 --- /dev/null +++ b/tests/properties/fixtures/disk-usage.yaml @@ -0,0 +1,2 @@ +properties: + - disk-usage