Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reload credentials before writing to avoid clashes
The credentials file is currently read once in main, and then those credentials are stored in memory and used as the basis for writing to the credentials file when update_credentials_file is eventually called. This allows lots of time for other processes to write to the credentials file, and awsmfa then obliterates those changes when it writes the file. There is no easy way to ensure that multiple processes co-operate, but we can at least reduce the timeframe for clashes, and this commit does that by simply reloading the credentials before updating and writing.
- Loading branch information