Merge pull request #24760 from cachedout/issue_24084

Fix GPG in #24084
This commit is contained in:
Mike Place 2015-06-17 11:33:17 -06:00
commit 7b8609b6aa

View File

@ -646,14 +646,14 @@ def import_key(user=None,
log.debug('imported_data {0}'.format(list(import_result.__dict__.keys())))
log.debug('imported_data {0}'.format(counts))
if counts['imported'] or counts['imported_rsa']:
if counts.get('imported') or counts.get('imported_rsa'):
ret['message'] = 'Successfully imported key(s).'
elif counts['unchanged']:
elif counts.get('unchanged'):
ret['message'] = 'Key(s) already exist in keychain.'
elif counts['not_imported']:
elif counts.get('not_imported'):
ret['res'] = False
ret['message'] = 'Unable to import key.'
elif not counts['count']:
elif not counts.get('count'):
ret['res'] = False
ret['message'] = 'Unable to import key.'