Skip to content

Commit

Permalink
Merge pull request #86 from pegacloud/feature/default-credentials-chain
Browse files Browse the repository at this point in the history
restoring default credentials object
  • Loading branch information
kahing authored Jun 11, 2016
2 parents 27b5b75 + a019b0a commit f64c04f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,16 @@ func mount(
mountPoint string,
flags *FlagStorage) (mfs *fuse.MountedFileSystem, err error) {

var creds *credentials.Credentials
if len(flags.Profile) > 0 {
creds = credentials.NewSharedCredentials(os.Getenv("HOME")+"/.aws/credentials", flags.Profile)
}

awsConfig := &aws.Config{
Region: &flags.Region,
Logger: GetLogger("s3"),
Credentials: creds,
//LogLevel: aws.LogLevel(aws.LogDebug),
}

if len(flags.Profile) > 0 {
awsConfig.Credentials = credentials.NewSharedCredentials(os.Getenv("HOME")+"/.aws/credentials", flags.Profile)
}

if len(flags.Endpoint) > 0 {
awsConfig.Endpoint = &flags.Endpoint
}
Expand Down

0 comments on commit f64c04f

Please sign in to comment.