mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Removing unecessary exception in jenkins_plugin (#24968)
This commit is contained in:
parent
825d9df5ea
commit
09e80a1306
1 changed files with 9 additions and 8 deletions
|
@ -18,10 +18,11 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
ANSIBLE_METADATA = {'metadata_version': '1.0',
|
ANSIBLE_METADATA = {
|
||||||
'status': ['preview'],
|
'metadata_version': '1.0',
|
||||||
'supported_by': 'community'}
|
'status': ['preview'],
|
||||||
|
'supported_by': 'community'
|
||||||
|
}
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
|
@ -330,13 +331,13 @@ class JenkinsPlugin(object):
|
||||||
csrf_data = self._get_json_data(
|
csrf_data = self._get_json_data(
|
||||||
"%s/%s" % (self.url, "api/json"), 'CSRF')
|
"%s/%s" % (self.url, "api/json"), 'CSRF')
|
||||||
|
|
||||||
try:
|
if 'useCrumbs' not in csrf_data:
|
||||||
return csrf_data["useCrumbs"]
|
|
||||||
except:
|
|
||||||
self.module.fail_json(
|
self.module.fail_json(
|
||||||
msg="Required fields not found in the Crum response.",
|
msg="Required fields not found in the Crumbs response.",
|
||||||
details=csrf_data)
|
details=csrf_data)
|
||||||
|
|
||||||
|
return csrf_data['useCrumbs']
|
||||||
|
|
||||||
def _get_json_data(self, url, what, **kwargs):
|
def _get_json_data(self, url, what, **kwargs):
|
||||||
# Get the JSON data
|
# Get the JSON data
|
||||||
r = self._get_url_data(url, what, **kwargs)
|
r = self._get_url_data(url, what, **kwargs)
|
||||||
|
|
Loading…
Reference in a new issue