Cleanup #11029 to use go autocast-after-type-switch

(thanks to brendandburns for the suggestion)
This commit is contained in:
Justin Santa Barbara 2015-07-28 11:58:06 -04:00
parent c5bffaaf31
commit edd21d1e7a

View File

@ -1694,10 +1694,9 @@ func (s *AWSCloud) ensureSecurityGroup(name string, description string, vpcID st
createResponse, err := s.ec2.CreateSecurityGroup(createRequest)
if err != nil {
ignore := false
switch err.(type) {
switch err := err.(type) {
case awserr.Error:
awsError := err.(awserr.Error)
if awsError.Code() == "InvalidGroup.Duplicate" && attempt < MaxReadThenCreateRetries {
if err.Code() == "InvalidGroup.Duplicate" && attempt < MaxReadThenCreateRetries {
glog.V(2).Infof("Got InvalidGroup.Duplicate while creating security group (race?); will retry")
ignore = true
}