Refactor notifications.py

Converted all relevant functions to use helpers.<insert function>
instead of a specific import.

Added commas to last entries of mapping tuples.

Change-Id: Idc63572a57fa2e4f1cf5b442027dd7f5e99aefdb
This commit is contained in:
tanhengyeow 2018-07-15 23:09:31 +08:00
parent 5a1150b65a
commit 086fabe2b3
1 changed files with 5 additions and 3 deletions

View File

@ -27,7 +27,7 @@ Jenkins notification plugin.
import xml.etree.ElementTree as XML
import jenkins_jobs.modules.base
from jenkins_jobs.modules.helpers import convert_mapping_to_xml
import jenkins_jobs.modules.helpers as helpers
def http_endpoint(registry, xml_parent, data):
@ -65,8 +65,10 @@ def http_endpoint(registry, xml_parent, data):
('', 'event', event, supported_events),
('timeout', 'timeout', 30000),
('url', 'url', None),
('log', 'loglines', 0)]
convert_mapping_to_xml(endpoint_element, data, mapping, fail_required=True)
('log', 'loglines', 0),
]
helpers.convert_mapping_to_xml(
endpoint_element, data, mapping, fail_required=True)
class Notifications(jenkins_jobs.modules.base.Base):