- removed import of sys module.
- HAS_BOTO constant to check if import was successful.
- trigger a failure when import fails.
- removed unnecessary imports.
Or is "rules_egree" supposed to be a plural? The sentence is difficult to parse.
Maybe the correct fix is to "Purge existing rules on security group that are not found in rules_egress"?