Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/azure-cli-core/azure/cli/core/_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def _load_tokens_from_file(file_path):
raise CLIError("Failed to load token files. If you have a repro, please log an issue at "
"https://github.com/Azure/azure-cli/issues. At the same time, you can clean "
"up by running 'az account clear' and then 'az login'. (Inner Error: {})".format(ex))
logger.debug("'%s' is not a file or doesn't exist.", file_path)
return []


Expand Down
5 changes: 3 additions & 2 deletions src/azure-cli-core/azure/cli/core/tests/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1787,8 +1787,9 @@ def get_auth_context(_, authority, **kwargs): # pylint: disable=unused-argument
self.assertEqual(token_type, token_entry2['tokenType'])

@mock.patch('azure.cli.core._profile.get_file_json', autospec=True)
def test_credscache_good_error_on_file_corruption(self, mock_read_file):
mock_read_file.side_effect = ValueError('a bad error for you')
@mock.patch('os.path.isfile', autospec=True, return_value=True)
def test_credscache_good_error_on_file_corruption(self, isfile_mock, get_file_json_mock):
get_file_json_mock.side_effect = ValueError('a bad error for you')
cli = DummyCli()

# action
Expand Down