summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-07-31 00:42:40 +0000
committerGerrit Code Review <review@openstack.org>2018-07-31 00:42:40 +0000
commit9428f49fe017ff5751c9e43042fcc27fcf7390ba (patch)
treedee6763137a04eee0f05abe89fa2fce6b499a003
parentc33dbaaaae0cc760498924dc25c7c99396c5702b (diff)
parentfada164a7da21e5e3c4b885ec95a4b72eaa87b4e (diff)
Merge "ssh-agent-credentials: Support ignore-missing-credentials param"
-rw-r--r--jenkins_jobs/modules/wrappers.py8
-rw-r--r--tests/wrappers/fixtures/ssh-agent-credentials001.xml1
-rw-r--r--tests/wrappers/fixtures/ssh-agent-credentials002.xml1
-rw-r--r--tests/wrappers/fixtures/ssh-agent-credentials003.xml1
-rw-r--r--tests/wrappers/fixtures/ssh-agent-credentials004.xml1
5 files changed, 12 insertions, 0 deletions
diff --git a/jenkins_jobs/modules/wrappers.py b/jenkins_jobs/modules/wrappers.py
index 3f2901e..d8f3334 100644
--- a/jenkins_jobs/modules/wrappers.py
+++ b/jenkins_jobs/modules/wrappers.py
@@ -1752,6 +1752,8 @@ def ssh_agent_credentials(registry, xml_parent, data):
1752 1752
1753 :arg list users: A list of Jenkins users credential IDs (required) 1753 :arg list users: A list of Jenkins users credential IDs (required)
1754 :arg str user: The user id of the jenkins user credentials (deprecated) 1754 :arg str user: The user id of the jenkins user credentials (deprecated)
1755 :arg bool ignore-missing-credentials: Specifies the option to ignore
1756 missing credentials (default false)
1755 1757
1756 Example: 1758 Example:
1757 1759
@@ -1812,6 +1814,12 @@ def ssh_agent_credentials(registry, xml_parent, data):
1812 for user in user_list: 1814 for user in user_list:
1813 XML.SubElement(entry_xml, xml_key).text = user 1815 XML.SubElement(entry_xml, xml_key).text = user
1814 1816
1817 mapping = [
1818 ('ignore-missing-credentials', 'ignoreMissing', False),
1819 ]
1820 helpers.convert_mapping_to_xml(entry_xml, data, mapping,
1821 fail_required=False)
1822
1815 1823
1816def credentials_binding(registry, xml_parent, data): 1824def credentials_binding(registry, xml_parent, data):
1817 """yaml: credentials-binding 1825 """yaml: credentials-binding
diff --git a/tests/wrappers/fixtures/ssh-agent-credentials001.xml b/tests/wrappers/fixtures/ssh-agent-credentials001.xml
index 48ad908..0fe0d90 100644
--- a/tests/wrappers/fixtures/ssh-agent-credentials001.xml
+++ b/tests/wrappers/fixtures/ssh-agent-credentials001.xml
@@ -3,6 +3,7 @@
3 <buildWrappers> 3 <buildWrappers>
4 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper> 4 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
5 <user>49d20745-9889-4c02-b286-fc6fb89c36bd</user> 5 <user>49d20745-9889-4c02-b286-fc6fb89c36bd</user>
6 <ignoreMissing>false</ignoreMissing>
6 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper> 7 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
7 </buildWrappers> 8 </buildWrappers>
8</project> 9</project>
diff --git a/tests/wrappers/fixtures/ssh-agent-credentials002.xml b/tests/wrappers/fixtures/ssh-agent-credentials002.xml
index 1b9e1d1..2b6f9fe 100644
--- a/tests/wrappers/fixtures/ssh-agent-credentials002.xml
+++ b/tests/wrappers/fixtures/ssh-agent-credentials002.xml
@@ -6,6 +6,7 @@
6 <string>44747833-247a-407a-a98f-a5a2d785111c</string> 6 <string>44747833-247a-407a-a98f-a5a2d785111c</string>
7 <string>f1c0f777-7ac6-43fd-b5c7-68b420aa1392</string> 7 <string>f1c0f777-7ac6-43fd-b5c7-68b420aa1392</string>
8 <string>dd647a01-be21-402b-bfc5-a4e89be7d0c4</string> 8 <string>dd647a01-be21-402b-bfc5-a4e89be7d0c4</string>
9 <ignoreMissing>false</ignoreMissing>
9 </credentialIds> 10 </credentialIds>
10 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper> 11 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
11 </buildWrappers> 12 </buildWrappers>
diff --git a/tests/wrappers/fixtures/ssh-agent-credentials003.xml b/tests/wrappers/fixtures/ssh-agent-credentials003.xml
index cc332cf..ab9fad8 100644
--- a/tests/wrappers/fixtures/ssh-agent-credentials003.xml
+++ b/tests/wrappers/fixtures/ssh-agent-credentials003.xml
@@ -5,6 +5,7 @@
5 <credentialIds> 5 <credentialIds>
6 <string>44747833-247a-407a-a98f-a5a2d785111c</string> 6 <string>44747833-247a-407a-a98f-a5a2d785111c</string>
7 <string>dd647a01-be21-402b-bfc5-a4e89be7d0c4</string> 7 <string>dd647a01-be21-402b-bfc5-a4e89be7d0c4</string>
8 <ignoreMissing>false</ignoreMissing>
8 </credentialIds> 9 </credentialIds>
9 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper> 10 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
10 </buildWrappers> 11 </buildWrappers>
diff --git a/tests/wrappers/fixtures/ssh-agent-credentials004.xml b/tests/wrappers/fixtures/ssh-agent-credentials004.xml
index 48ad908..0fe0d90 100644
--- a/tests/wrappers/fixtures/ssh-agent-credentials004.xml
+++ b/tests/wrappers/fixtures/ssh-agent-credentials004.xml
@@ -3,6 +3,7 @@
3 <buildWrappers> 3 <buildWrappers>
4 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper> 4 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
5 <user>49d20745-9889-4c02-b286-fc6fb89c36bd</user> 5 <user>49d20745-9889-4c02-b286-fc6fb89c36bd</user>
6 <ignoreMissing>false</ignoreMissing>
6 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper> 7 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
7 </buildWrappers> 8 </buildWrappers>
8</project> 9</project>