boto/boto — pull request #2292 by danielgtaylor (2014-05-27 23:35:45+00:00)
Title: Add support for shared credentials file

Similar to https://github.com/boto/botocore/commit/0c16395e3b024f1b1cb43142f407884ea57fed83

Loads the config in two stages now (normal config, then shared credentials), introduces the `AWS_PROFILE` env var and adds a few new tests to cover possible cases. The loading order from highest to lowest precedence:

1. Directly passed from code
1. Environment variables for key/secret
1. Environment variables for profile
1. Shared credential file explicit profile
1. Shared credential file default profile
1. Config file explicit profile
1. Config file `Credentials` section

A profile passed from code overrides any set in an environment variable.

@jamesls please take a look.