Merge "upgrade hacking module"
This commit is contained in:
commit
561081fef0
@ -17,6 +17,7 @@ import io
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
import platform
|
import platform
|
||||||
|
import sys
|
||||||
|
|
||||||
from stevedore import extension
|
from stevedore import extension
|
||||||
import yaml
|
import yaml
|
||||||
@ -26,6 +27,9 @@ from jenkins_jobs.config import JJBConfig
|
|||||||
from jenkins_jobs import utils
|
from jenkins_jobs import utils
|
||||||
from jenkins_jobs import version
|
from jenkins_jobs import version
|
||||||
|
|
||||||
|
if sys.version_info[0] != 2:
|
||||||
|
from importlib import reload
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
|
|
||||||
|
@ -417,7 +417,7 @@ class YamlInclude(BaseYAMLObject):
|
|||||||
try:
|
try:
|
||||||
with io.open(filename, 'r', encoding='utf-8') as f:
|
with io.open(filename, 'r', encoding='utf-8') as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
except:
|
except Exception:
|
||||||
logger.error("Failed to include file using search path: '{0}'"
|
logger.error("Failed to include file using search path: '{0}'"
|
||||||
.format(':'.join(loader.search_path)))
|
.format(':'.join(loader.search_path)))
|
||||||
raise
|
raise
|
||||||
|
@ -668,8 +668,8 @@ def dynamic_string_scriptler_param(registry, xml_parent, data):
|
|||||||
|
|
||||||
def dynamic_param_common(registry, xml_parent, data, ptype):
|
def dynamic_param_common(registry, xml_parent, data, ptype):
|
||||||
pdef = base_param(registry, xml_parent, data, False,
|
pdef = base_param(registry, xml_parent, data, False,
|
||||||
'com.seitenbau.jenkins.plugins.dynamicparameter.'
|
'com.seitenbau.jenkins.plugins.dynamicparameter.' +
|
||||||
+ ptype)
|
ptype)
|
||||||
XML.SubElement(pdef, '__remote').text = str(
|
XML.SubElement(pdef, '__remote').text = str(
|
||||||
data.get('remote', False)).lower()
|
data.get('remote', False)).lower()
|
||||||
XML.SubElement(pdef, '__script').text = data.get('script', None)
|
XML.SubElement(pdef, '__script').text = data.get('script', None)
|
||||||
|
@ -136,8 +136,8 @@ class Matrix(jenkins_jobs.modules.base.Base):
|
|||||||
root = XML.Element('matrix-project')
|
root = XML.Element('matrix-project')
|
||||||
|
|
||||||
# Default to 'execution-strategy'
|
# Default to 'execution-strategy'
|
||||||
strategies = ([s for s in data.keys() if s.endswith('-strategy')]
|
strategies = ([s for s in data.keys() if s.endswith('-strategy')] or
|
||||||
or ['execution-strategy'])
|
['execution-strategy'])
|
||||||
|
|
||||||
# Job can not have multiple strategies
|
# Job can not have multiple strategies
|
||||||
if len(strategies) > 1:
|
if len(strategies) > 1:
|
||||||
|
@ -656,8 +656,8 @@ def clone_workspace(registry, xml_parent, data):
|
|||||||
|
|
||||||
if 'criteria' in data and criteria not in criteria_list:
|
if 'criteria' in data and criteria not in criteria_list:
|
||||||
raise JenkinsJobsException(
|
raise JenkinsJobsException(
|
||||||
'clone-workspace criteria must be one of: '
|
'clone-workspace criteria must be one of: ' +
|
||||||
+ ', '.join(criteria_list))
|
', '.join(criteria_list))
|
||||||
else:
|
else:
|
||||||
XML.SubElement(cloneworkspace, 'criteria').text = criteria
|
XML.SubElement(cloneworkspace, 'criteria').text = criteria
|
||||||
|
|
||||||
@ -667,8 +667,8 @@ def clone_workspace(registry, xml_parent, data):
|
|||||||
|
|
||||||
if 'archive-method' in data and archive_method not in archive_list:
|
if 'archive-method' in data and archive_method not in archive_list:
|
||||||
raise JenkinsJobsException(
|
raise JenkinsJobsException(
|
||||||
'clone-workspace archive-method must be one of: '
|
'clone-workspace archive-method must be one of: ' +
|
||||||
+ ', '.join(archive_list))
|
', '.join(archive_list))
|
||||||
else:
|
else:
|
||||||
XML.SubElement(cloneworkspace, 'archiveMethod').text = archive_method
|
XML.SubElement(cloneworkspace, 'archiveMethod').text = archive_method
|
||||||
|
|
||||||
@ -2083,8 +2083,8 @@ def claim_build(registry, xml_parent, data):
|
|||||||
|
|
||||||
def base_email_ext(registry, xml_parent, data, ttype):
|
def base_email_ext(registry, xml_parent, data, ttype):
|
||||||
trigger = XML.SubElement(xml_parent,
|
trigger = XML.SubElement(xml_parent,
|
||||||
'hudson.plugins.emailext.plugins.trigger.'
|
'hudson.plugins.emailext.plugins.trigger.' +
|
||||||
+ ttype)
|
ttype)
|
||||||
email = XML.SubElement(trigger, 'email')
|
email = XML.SubElement(trigger, 'email')
|
||||||
XML.SubElement(email, 'recipientList').text = ''
|
XML.SubElement(email, 'recipientList').text = ''
|
||||||
XML.SubElement(email, 'subject').text = '$PROJECT_DEFAULT_SUBJECT'
|
XML.SubElement(email, 'subject').text = '$PROJECT_DEFAULT_SUBJECT'
|
||||||
@ -4033,8 +4033,8 @@ def postbuildscript(registry, xml_parent, data):
|
|||||||
for shell_script in script_data:
|
for shell_script in script_data:
|
||||||
script_xml = XML.SubElement(
|
script_xml = XML.SubElement(
|
||||||
scripts_xml,
|
scripts_xml,
|
||||||
'org.jenkinsci.plugins.postbuildscript.'
|
'org.jenkinsci.plugins.postbuildscript.' +
|
||||||
+ script_types[step])
|
script_types[step])
|
||||||
file_path_xml = XML.SubElement(script_xml, 'filePath')
|
file_path_xml = XML.SubElement(script_xml, 'filePath')
|
||||||
file_path_xml.text = shell_script
|
file_path_xml.text = shell_script
|
||||||
|
|
||||||
|
@ -153,9 +153,9 @@ def build_gerrit_triggers(xml_parent, data):
|
|||||||
"format instead.", event)
|
"format instead.", event)
|
||||||
|
|
||||||
if not tag_name:
|
if not tag_name:
|
||||||
known = ', '.join(available_simple_triggers.keys()
|
known = ', '.join(available_simple_triggers.keys() +
|
||||||
+ ['comment-added-event',
|
['comment-added-event',
|
||||||
'comment-added-contains-event'])
|
'comment-added-contains-event'])
|
||||||
msg = ("The event '%s' under 'trigger-on' is not one of the "
|
msg = ("The event '%s' under 'trigger-on' is not one of the "
|
||||||
"known: %s.") % (event, known)
|
"known: %s.") % (event, known)
|
||||||
raise JenkinsJobsException(msg)
|
raise JenkinsJobsException(msg)
|
||||||
@ -880,8 +880,8 @@ def jms_messaging(registry, xml_parent, data):
|
|||||||
if len(checks) > 0:
|
if len(checks) > 0:
|
||||||
msgchecks = XML.SubElement(jmsm, 'checks')
|
msgchecks = XML.SubElement(jmsm, 'checks')
|
||||||
for check in checks:
|
for check in checks:
|
||||||
msgcheck = XML.SubElement(msgchecks, namespace
|
msgcheck = XML.SubElement(msgchecks, namespace +
|
||||||
+ 'messaging.checks.MsgCheck')
|
'messaging.checks.MsgCheck')
|
||||||
mapping = [
|
mapping = [
|
||||||
('field', 'field', ''),
|
('field', 'field', ''),
|
||||||
('expected-value', 'expectedValue', '')]
|
('expected-value', 'expectedValue', '')]
|
||||||
|
@ -21,6 +21,7 @@ http://docs.openstack.org/infra/zuul/launchers.html#zuul-parameters
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
|
import jenkins_jobs.modules.base
|
||||||
|
|
||||||
|
|
||||||
def zuul():
|
def zuul():
|
||||||
@ -55,7 +56,6 @@ def zuul_post():
|
|||||||
- zuul-post
|
- zuul-post
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import jenkins_jobs.modules.base
|
|
||||||
|
|
||||||
ZUUL_PARAMETERS = [
|
ZUUL_PARAMETERS = [
|
||||||
{'string':
|
{'string':
|
||||||
|
@ -99,8 +99,8 @@ class YamlParser(object):
|
|||||||
if not hasattr(path, 'read') and os.path.isdir(path):
|
if not hasattr(path, 'read') and os.path.isdir(path):
|
||||||
files_to_process.extend([os.path.join(path, f)
|
files_to_process.extend([os.path.join(path, f)
|
||||||
for f in sorted(os.listdir(path))
|
for f in sorted(os.listdir(path))
|
||||||
if (f.endswith('.yml')
|
if (f.endswith('.yml') or
|
||||||
or f.endswith('.yaml'))])
|
f.endswith('.yaml'))])
|
||||||
else:
|
else:
|
||||||
files_to_process.append(path)
|
files_to_process.append(path)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# The order of packages is significant, because pip processes them in the order
|
# The order of packages is significant, because pip processes them in the order
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
hacking<0.13,>=0.12.0 # Apache-2.0
|
hacking>=1.1.0 # Apache-2.0
|
||||||
|
|
||||||
coverage>=4.0 # Apache-2.0
|
coverage>=4.0 # Apache-2.0
|
||||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||||
|
@ -251,7 +251,7 @@ class TestJenkinsGetPluginInfoError(CmdTestsBase):
|
|||||||
self.execute_jenkins_jobs_with_args(args)
|
self.execute_jenkins_jobs_with_args(args)
|
||||||
except jenkins.JenkinsException:
|
except jenkins.JenkinsException:
|
||||||
self.fail("jenkins.JenkinsException propagated to main")
|
self.fail("jenkins.JenkinsException propagated to main")
|
||||||
except:
|
except Exception:
|
||||||
pass # only care about jenkins.JenkinsException for now
|
pass # only care about jenkins.JenkinsException for now
|
||||||
|
|
||||||
@mock.patch('jenkins.Jenkins.get_plugins')
|
@mock.patch('jenkins.Jenkins.get_plugins')
|
||||||
|
Loading…
Reference in New Issue
Block a user