Support hacking module <= 0.10.1

Update version restrictions to allow hacking module <= 0.10.1 and fix
any style errors reported by the latest version.

Change-Id: Ia608096342b11e411e56a86e8f289f9891077895
This commit is contained in:
Darragh Bailey 2015-02-21 20:12:08 +00:00
parent 9cbba31054
commit 0c012a93c4
7 changed files with 50 additions and 50 deletions

View File

@ -158,7 +158,7 @@ def setup_config_settings(options):
if os.path.isfile(localconf): if os.path.isfile(localconf):
conf = localconf conf = localconf
config = configparser.ConfigParser() config = configparser.ConfigParser()
## Load default config always # Load default config always
config.readfp(StringIO(DEFAULT_CONF)) config.readfp(StringIO(DEFAULT_CONF))
if os.path.isfile(conf): if os.path.isfile(conf):
logger.debug("Reading config from {0}".format(conf)) logger.debug("Reading config from {0}".format(conf))

View File

@ -938,7 +938,7 @@ def conditional_step(parser, xml_parent, data):
br = XML.SubElement(ctag, 'bestResult') br = XML.SubElement(ctag, 'bestResult')
br_name = cdata['condition-best'] br_name = cdata['condition-best']
if not br_name in hudson_model.THRESHOLDS: if br_name not in hudson_model.THRESHOLDS:
raise JenkinsJobsException( raise JenkinsJobsException(
"threshold must be one of %s" % "threshold must be one of %s" %
", ".join(hudson_model.THRESHOLDS.keys())) ", ".join(hudson_model.THRESHOLDS.keys()))

View File

@ -261,8 +261,8 @@ def trigger_parameterized_builds(parser, xml_parent, data):
'matrix.MatrixSubsetBuildParameters') 'matrix.MatrixSubsetBuildParameters')
XML.SubElement(subset, 'filter').text = \ XML.SubElement(subset, 'filter').text = \
project_def['restrict-matrix-project'] project_def['restrict-matrix-project']
if 'node-label-name' in project_def or \ if ('node-label-name' in project_def or
'node-label' in project_def: 'node-label' in project_def):
params = XML.SubElement(tconfigs, params = XML.SubElement(tconfigs,
'org.jvnet.jenkins.plugins.' 'org.jvnet.jenkins.plugins.'
'nodelabelparameter.' 'nodelabelparameter.'
@ -1041,8 +1041,7 @@ def violations(parser, xml_parent, data):
configs = XML.SubElement(config, 'typeConfigs') configs = XML.SubElement(config, 'typeConfigs')
XML.SubElement(configs, 'no-comparator') XML.SubElement(configs, 'no-comparator')
for name in [ for name in ['checkstyle',
'checkstyle',
'codenarc', 'codenarc',
'cpd', 'cpd',
'cpplint', 'cpplint',
@ -1496,7 +1495,7 @@ def email_ext(parser, xml_parent, data):
'only-configurations': 'ONLY_CONFIGURATIONS', 'only-configurations': 'ONLY_CONFIGURATIONS',
'only-parent': 'ONLY_PARENT'} 'only-parent': 'ONLY_PARENT'}
matrix_trigger = data.get('matrix-trigger', None) matrix_trigger = data.get('matrix-trigger', None)
## If none defined, then do not create entry # If none defined, then do not create entry
if matrix_trigger is not None: if matrix_trigger is not None:
if matrix_trigger not in matrix_dict: if matrix_trigger not in matrix_dict:
raise JenkinsJobsException("matrix-trigger entered is not valid, " raise JenkinsJobsException("matrix-trigger entered is not valid, "
@ -4148,7 +4147,7 @@ def conditional_publisher(parser, xml_parent, data):
br = XML.SubElement(ctag, 'bestResult') br = XML.SubElement(ctag, 'bestResult')
br_name = cdata['condition-best'] br_name = cdata['condition-best']
if not br_name in hudson_model.THRESHOLDS: if br_name not in hudson_model.THRESHOLDS:
raise JenkinsJobsException( raise JenkinsJobsException(
"threshold must be one of %s" % "threshold must be one of %s" %
", ".join(hudson_model.THRESHOLDS.keys())) ", ".join(hudson_model.THRESHOLDS.keys()))

View File

@ -689,7 +689,8 @@ def tfs(parser, xml_parent, data):
""" """
tfs = XML.SubElement(xml_parent, 'scm', {'class': 'hudson.plugins.tfs.' tfs = XML.SubElement(xml_parent, 'scm',
{'class': 'hudson.plugins.tfs.'
'TeamFoundationServerScm'}) 'TeamFoundationServerScm'})
XML.SubElement(tfs, 'serverUrl').text = str( XML.SubElement(tfs, 'serverUrl').text = str(
data.get('server-url', '')) data.get('server-url', ''))
@ -709,8 +710,8 @@ def tfs(parser, xml_parent, data):
data.get('use-update', True)) data.get('use-update', True))
store = data.get('web-access', None) store = data.get('web-access', None)
if 'web-access' in data and isinstance(store, list): if 'web-access' in data and isinstance(store, list):
web = XML.SubElement(tfs, 'repositoryBrowser', {'class': 'hudson.' web = XML.SubElement(tfs, 'repositoryBrowser',
'plugins.tfs.browsers.' {'class': 'hudson.plugins.tfs.browsers.'
'TeamSystemWebAccessBrowser'}) 'TeamSystemWebAccessBrowser'})
XML.SubElement(web, 'url').text = str(store[0].get('web-url', None)) XML.SubElement(web, 'url').text = str(store[0].get('web-url', None))
elif 'web-access' in data and store is None: elif 'web-access' in data and store is None:
@ -848,8 +849,8 @@ def hg(self, xml_parent, data):
raise JenkinsJobsException("Browser entered is not valid must be one " raise JenkinsJobsException("Browser entered is not valid must be one "
"of: %s" % ", ".join(browserdict.keys())) "of: %s" % ", ".join(browserdict.keys()))
if browser != 'auto': if browser != 'auto':
bc = XML.SubElement(scm, 'browser', {'class': bc = XML.SubElement(scm, 'browser',
'hudson.plugins.mercurial.browser.' + {'class': 'hudson.plugins.mercurial.browser.' +
browserdict[browser]}) browserdict[browser]})
if 'browser-url' in data: if 'browser-url' in data:
XML.SubElement(bc, 'url').text = data['browser-url'] XML.SubElement(bc, 'url').text = data['browser-url']

View File

@ -1,4 +1,4 @@
hacking>=0.5.6,<0.8 hacking>=0.5.6,<=10.1
coverage>=3.6 coverage>=3.6
discover discover
fixtures fixtures