diff --git a/jenkins_jobs/modules/triggers.py b/jenkins_jobs/modules/triggers.py index 4f42cc00a..f42d56407 100644 --- a/jenkins_jobs/modules/triggers.py +++ b/jenkins_jobs/modules/triggers.py @@ -632,7 +632,7 @@ def pollscm(parser, xml_parent, data): cron = data ipch = 'false' - if not cron: + if not cron and cron != '': raise InvalidAttributeError('cron', cron) scmtrig = XML.SubElement(xml_parent, 'hudson.triggers.SCMTrigger') diff --git a/tests/triggers/fixtures/pollscm004.xml b/tests/triggers/fixtures/pollscm004.xml new file mode 100644 index 000000000..239bed26e --- /dev/null +++ b/tests/triggers/fixtures/pollscm004.xml @@ -0,0 +1,9 @@ + + + + + + false + + + diff --git a/tests/triggers/fixtures/pollscm004.yaml b/tests/triggers/fixtures/pollscm004.yaml new file mode 100644 index 000000000..3d0d9d5e3 --- /dev/null +++ b/tests/triggers/fixtures/pollscm004.yaml @@ -0,0 +1,3 @@ +triggers: + - pollscm: + cron: ""