aws/config: Shortened conditions [cleanup]

This commit is contained in:
Radek Simko 2016-08-10 15:25:16 +01:00
parent b98e5f2073
commit 2073e80c66
No known key found for this signature in database
GPG Key ID: 4DECCD28668ED457
2 changed files with 6 additions and 6 deletions

View File

@ -111,10 +111,10 @@ func GetCredentials(c *Config) *awsCredentials.Credentials {
} }
usedEndpoint := setOptionalEndpoint(cfg) usedEndpoint := setOptionalEndpoint(cfg)
if !c.SkipMetadataApiCheck {
// Real AWS should reply to a simple metadata request. // Real AWS should reply to a simple metadata request.
// We check it actually does to ensure something else didn't just // We check it actually does to ensure something else didn't just
// happen to be listening on the same IP:Port // happen to be listening on the same IP:Port
if c.SkipMetadataApiCheck == false {
metadataClient := ec2metadata.New(session.New(cfg)) metadataClient := ec2metadata.New(session.New(cfg))
if metadataClient.Available() { if metadataClient.Available() {
providers = append(providers, &ec2rolecreds.EC2RoleProvider{ providers = append(providers, &ec2rolecreds.EC2RoleProvider{

View File

@ -203,7 +203,7 @@ func (c *Config) Client() (interface{}, error) {
client.iamconn = iam.New(awsIamSess) client.iamconn = iam.New(awsIamSess)
client.stsconn = sts.New(sess) client.stsconn = sts.New(sess)
if c.SkipIamCredsValidation == false { if !c.SkipIamCredsValidation {
err = c.ValidateCredentials(client.stsconn) err = c.ValidateCredentials(client.stsconn)
if err != nil { if err != nil {
errs = append(errs, err) errs = append(errs, err)
@ -211,7 +211,7 @@ func (c *Config) Client() (interface{}, error) {
} }
} }
if c.SkipIamAccountId == false { if !c.SkipIamAccountId {
accountId, err := GetAccountId(client.iamconn, client.stsconn, cp.ProviderName) accountId, err := GetAccountId(client.iamconn, client.stsconn, cp.ProviderName)
if err == nil { if err == nil {
client.accountid = accountId client.accountid = accountId