Use correct key for this locale lookup

This commit is contained in:
Luke Murphy 2019-06-28 19:51:55 +02:00
parent 14c4fafd39
commit 5744dbd6fa
No known key found for this signature in database
GPG key ID: 5E2EF5A63E3718CC
2 changed files with 6 additions and 4 deletions

View file

@ -40,7 +40,7 @@
"websocket_request_expected": "Expected a WebSocket request",
"cannot_open_file": "Could not open file {file:s} (reason: {error:s})",
"cannot_write_file": "Could not write file {file:s} (reason: {error:s})",
"unknown_error_reading_file": "Unknown error while trying to read file {file:s}",
"unknown_error_reading_file": "Unknown error while trying to read file {file:s} (reason: {error:s})",
"corrupted_json": "Corrupted json read from {ressource:s} (reason: {error:s})",
"corrupted_yaml": "Corrupted yaml read from {ressource:s} (reason: {error:s})",
"error_writing_file": "Error when writing file {file:s}: {error:s}",

View file

@ -31,8 +31,9 @@ def read_file(file_path):
file_content = f.read()
except IOError as e:
raise MoulinetteError('cannot_open_file', file=file_path, error=str(e))
except Exception as e:
raise MoulinetteError('error_reading_file', file=file_path, error=str(e))
except Exception:
raise MoulinetteError('unknown_error_reading_file',
file=file_path, error=str(e))
return file_content
@ -105,7 +106,8 @@ def read_ldif(file_path, filtred_entries=[]):
except IOError as e:
raise MoulinetteError('cannot_open_file', file=file_path, error=str(e))
except Exception as e:
raise MoulinetteError('error_reading_file', file=file_path, error=str(e))
raise MoulinetteError('unknown_error_reading_file',
file=file_path, error=str(e))
return parser.all_records