mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-09-30 13:33:21 -07:00
github_deploy_key: make sure variable exists before use (#10857)
Make sure variable exists before use.
This commit is contained in:
parent
648ff7db02
commit
68684a7a4c
2 changed files with 4 additions and 0 deletions
|
@ -284,6 +284,8 @@ class GithubDeployKey(object):
|
|||
body = info.get('body')
|
||||
if body:
|
||||
err = self.module.from_json(body)['message']
|
||||
else:
|
||||
err = None
|
||||
|
||||
if status_code == 401:
|
||||
self.module.fail_json(msg="Failed to connect to {0} due to invalid credentials".format(self.github_url), http_status_code=status_code, error=err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue