Refactor hipchat_notif.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: I87640188c900aef38ee368eca7540c3126274c2e
This commit is contained in:
tanhengyeow 2018-07-15 23:04:29 +08:00
parent 5a1150b65a
commit 191aa8a0dc
1 changed files with 4 additions and 3 deletions

View File

@ -82,7 +82,7 @@ from six.moves import configparser
import jenkins_jobs.errors
import jenkins_jobs.modules.base
from jenkins_jobs.modules.helpers import convert_mapping_to_xml
import jenkins_jobs.modules.helpers as helpers
logger = logging.getLogger(__name__)
@ -175,8 +175,9 @@ class HipChat(jenkins_jobs.modules.base.Base):
('notify-not-built', 'notifyNotBuilt', False),
('notify-unstable', 'notifyUnstable', False),
('notify-failure', 'notifyFailure', False),
('notify-back-to-normal', 'notifyBackToNormal', False)]
convert_mapping_to_xml(pdefhip,
('notify-back-to-normal', 'notifyBackToNormal', False),
]
helpers.convert_mapping_to_xml(pdefhip,
hipchat, mapping, fail_required=True)
publishers = xml_parent.find('publishers')