removing try...except, checking return of cache_file. If identity doesn't exist via Salt fileserver or local file, continue in the for loop.

This commit is contained in:
Gareth J. Greenaway 2015-09-26 10:21:51 -07:00
parent f639378fbf
commit fc36164ddf

View File

@ -146,15 +146,16 @@ def _git_run(command, cwd=None, runas=None, identity=None,
# try each of the identities, independently
for id_file in identity:
if 'salt://' in id_file:
try:
id_file = __salt__['cp.cache_file'](id_file)
except IOError as e:
log.debug(e)
raise CommandExecutionError(
'identity \'{0}\' does not exist.'.format(
id_file
)
)
_id_file = id_file
id_file = __salt__['cp.cache_file'](id_file)
if not id_file:
log.error('identity {0} does not exist.'.format(_id_file))
continue
else:
if not __salt__['file.file_exists'](id_file):
log.error('identity {0} does not exist.'.format(id_file))
continue
env = {
'GIT_IDENTITY': id_file
}