mirror of
https://github.com/docker/compose.git
synced 2025-07-23 13:45:00 +02:00
Don't mess with exiting .aws/credentials
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
0ae42dea04
commit
cb808dec31
@ -199,8 +199,15 @@ func (h contextCreateAWSHelper) saveCredentials(profile string, accessKeyID stri
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
credIni := ini.Empty()
|
credentials, err := ini.Load(file)
|
||||||
section, err := credIni.NewSection(profile)
|
if err != nil {
|
||||||
|
if !os.IsNotExist(err) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
credentials = ini.Empty()
|
||||||
|
}
|
||||||
|
|
||||||
|
section, err := credentials.NewSection(profile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -212,7 +219,7 @@ func (h contextCreateAWSHelper) saveCredentials(profile string, accessKeyID stri
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return credIni.SaveTo(file)
|
return credentials.SaveTo(file)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h contextCreateAWSHelper) saveRegion(profile, region string) error {
|
func (h contextCreateAWSHelper) saveRegion(profile, region string) error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user