summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortanhengyeow <E0032242@u.nus.edu>2018-07-27 21:45:37 +0800
committertanhengyeow <E0032242@u.nus.edu>2018-07-29 17:10:14 +0800
commitfada164a7da21e5e3c4b885ec95a4b72eaa87b4e (patch)
tree32fa2cdb214c9577cc9eb821c54233876bcd5084
parentcb6641d7f89ed1eca9c2d795f2f6fef3fad3a88d (diff)
ssh-agent-credentials: Support ignore-missing-credentials param
Change-Id: I5f78648600ef045dfe539a950daae14b304a74d9 Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
Notes
Notes (review): Code-Review+2: Thanh Ha <zxiiro@gmail.com> Code-Review+2: Kien Ha <kienha9922@gmail.com> Workflow+1: Kien Ha <kienha9922@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 31 Jul 2018 00:42:40 +0000 Reviewed-on: https://review.openstack.org/586554 Project: openstack-infra/jenkins-job-builder Branch: refs/heads/master
-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>