#NEWLINE# def internet_gateway_absent( name , detach = False , region = None , key = None , keyid = None , profile = None ) : #NEWLINE# #INDENT# '\n    Ensure the named internet gateway is absent.\n\n    name\n        Name of the internet gateway.\n\n    detach\n        First detach the internet gateway from a VPC, if attached.\n\n    region\n        Region to connect to.\n\n    key\n        Secret key to be used.\n\n    keyid\n        Access key to be used.\n\n    profile\n        A dict with region, key and keyid, or a pillar key (string) that\n        contains a dict with region, key and keyid.\n    ' #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'result' : True , #NEWLINE# 'comment' : '' , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# r = __salt__ [ 'boto_vpc.get_resource_id' ] ( 'internet_gateway' , name = name , region = region , key = key , keyid = keyid , profile = profile ) #NEWLINE# if ( 'error' in r ) : #NEWLINE# #INDENT# ret [ 'result' ] = False #NEWLINE# ret [ 'comment' ] = 'Failed to delete internet gateway: {0}.' . format ( r [ 'error' ] [ 'message' ] ) #NEWLINE# return ret #NEWLINE# #UNINDENT# igw_id = r [ 'id' ] #NEWLINE# if ( not igw_id ) : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Internet gateway {0} does not exist.' . format ( name ) #NEWLINE# return ret #NEWLINE# #UNINDENT# if __opts__ [ 'test' ] : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Internet gateway {0} is set to be removed.' . format ( name ) #NEWLINE# ret [ 'result' ] = None #NEWLINE# return ret #NEWLINE# #UNINDENT# r = __salt__ [ 'boto_vpc.delete_internet_gateway' ] ( internet_gateway_name = name , detach = detach , region = region , key = key , keyid = keyid , profile = profile ) #NEWLINE# if ( not r . get ( 'deleted' ) ) : #NEWLINE# #INDENT# ret [ 'result' ] = False #NEWLINE# ret [ 'comment' ] = 'Failed to delete internet gateway: {0}.' . format ( r [ 'error' ] [ 'message' ] ) #NEWLINE# return ret #NEWLINE# #UNINDENT# ret [ 'changes' ] [ 'old' ] = { #NEWLINE# #INDENT# 'internet_gateway' : igw_id , #NEWLINE# #UNINDENT# } #NEWLINE# ret [ 'changes' ] [ 'new' ] = { #NEWLINE# #INDENT# 'internet_gateway' : None , #NEWLINE# #UNINDENT# } #NEWLINE# ret [ 'comment' ] = 'Internet gateway {0} deleted.' . format ( name ) #NEWLINE# return ret