1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fix gitlab_project avatar_path open when undefined bug (#3926) (#3927) (#3928)

* fix gitlab_project avatar_path open when undefined bug (#3926)

* remove changelog fragment

(cherry picked from commit 11fcf661bf)

Co-authored-by: Josh <josham@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-12-20 20:22:29 +01:00 committed by GitHub
parent 6f5ad22d28
commit cce68def8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -299,10 +299,11 @@ class GitLabProject(object):
project = self.create_project(namespace, project_options) project = self.create_project(namespace, project_options)
# add avatar to project # add avatar to project
try: if options['avatar_path']:
project.avatar = open(options['avatar_path'], 'rb') try:
except IOError as e: project.avatar = open(options['avatar_path'], 'rb')
self._module.fail_json(msg='Cannot open {0}: {1}'.format(options['avatar_path'], e)) except IOError as e:
self._module.fail_json(msg='Cannot open {0}: {1}'.format(options['avatar_path'], e))
changed = True changed = True
else: else: