"""Destroy Security Group Resources."""
import logging
import requests

from ...consts import API_URL, HEADERS
from ...utils import get_template, get_vpc_id, check_task, Gate

LOG = logging.getLogger(__name__)


def destroy_sg(app='', env='', region='', **_):
    """Destroy Security Group.

    Args:
        account (str): AWS account name.
        region (str): Region name, e.g. us-east-1.

    Returns:
        True upon successful completion.
    """
    vpc = get_vpc_id(account=env, region=region)

    try:
        url = '{api}/securityGroups/{env}/{region}/{app}'.format(
            api=API_URL, env=env, region=region,
            app=app)
        security_group = Gate(url).get(vpcId=vpc)
    except AssertionError:
        raise

    if not security_group:
        LOG.info('Nothing to delete.')
        raise SystemExit
    else:
        LOG.info('Found Security Group in %(region)s: %(name)s',
                 security_group)

    destroy_request = get_template('destroy/destroy_sg.json.j2',
                                   app=app,
                                   env=env,
                                   region=region,
                                   vpc=vpc)

    response = Gate().tasks.post(destroy_request)

    check_task(response, app)

    return True

@@ -807,33 +807,8 @@
 .')%0A
-        raise SystemExit%0A
     
@@ -908,24 +908,28 @@
 ity_group)%0A%0A
+    
     destroy_
@@ -1012,24 +1012,28 @@
             
+    
 app=app,%0A   
@@ -1029,16 +1029,20 @@
 pp=app,%0A
+    
         
@@ -1108,24 +1108,28 @@
             
+  
+  
 region=regio
@@ -1166,16 +1166,20 @@
         
+    
 vpc=vpc)
@@ -1184,16 +1184,20 @@
 c)%0A%0A    
+ 
+   
 response
@@ -1235,16 +1235,20 @@
 quest)%0A%0A
+    
     chec

Remove SystemExit from `destroy-sg`