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) * remove changelog fragment
This commit is contained in:
parent
51838adf8c
commit
11fcf661bf
1 changed files with 5 additions and 4 deletions
|
@ -299,10 +299,11 @@ class GitLabProject(object):
|
|||
project = self.create_project(namespace, project_options)
|
||||
|
||||
# add avatar to project
|
||||
try:
|
||||
project.avatar = open(options['avatar_path'], 'rb')
|
||||
except IOError as e:
|
||||
self._module.fail_json(msg='Cannot open {0}: {1}'.format(options['avatar_path'], e))
|
||||
if options['avatar_path']:
|
||||
try:
|
||||
project.avatar = open(options['avatar_path'], 'rb')
|
||||
except IOError as e:
|
||||
self._module.fail_json(msg='Cannot open {0}: {1}'.format(options['avatar_path'], e))
|
||||
|
||||
changed = True
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue