Skip to content

Commit

Permalink
Code cleanup and fixing typo.
Browse files Browse the repository at this point in the history
Code cleanup and fixing typo.
  • Loading branch information
axozoid authored Jan 24, 2019
2 parents 278d769 + f2396e7 commit daa2936
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func editSecurityGroupRules(ec2object *ec2.EC2, group *ec2.DescribeSecurityGroup

if err != nil {
if aerr, ok := err.(awserr.Error); ok {
msgTxt := fmt.Sprintf("Security group update failed weith the code: '%s' and message: '%s'", aerr.Code(), aerr.Message())
msgTxt := fmt.Sprintf("Security group update failed with the code: '%s' and message: '%s'", aerr.Code(), aerr.Message())
outputMsg(msgTxt, logLevelError)
}
//return
Expand Down Expand Up @@ -362,21 +362,11 @@ func main() {

if errEC2 != nil {
if aerr, ok := errEC2.(awserr.Error); ok {
outputMsg("Can't describe security groups: "+aerr.Message(), logLevelError)
outputMsg("An error occurred while querying security groups: "+aerr.Message(), logLevelError)
}

}

if len(resEC2.SecurityGroups) == 0 {
outputMsg("Security groups not found.", logLevelError)
} else {
// showing a notice if not all SGs are found
if df := len(secGroups) - len(resEC2.SecurityGroups); df > 0 {
tmp := fmt.Sprintf("Warning: %d of %d security groups not found.", df, len(secGroups))
outputMsg(tmp, logLevelInfo)
}
}

// ------------------------------------------
// Stage 3. Syncing CIDRs

Expand Down

0 comments on commit daa2936

Please sign in to comment.