def event_source_mapping_absent(name, EventSourceArn, FunctionName, region=None, key=None, keyid=None, profile=None):
 ret = {'name': None, 'result': True, 'comment': '', 'changes': {}}
 desc = __salt__['boto_lambda.describe_event_source_mapping'](EventSourceArn=EventSourceArn, FunctionName=FunctionName, region=region, key=key, keyid=keyid, profile=profile)
 if ('error' in desc):
  ret['result'] = False
  ret['comment'] = 'Failed to delete event source mapping: {0}.'.format(desc['error']['message'])
  return ret
 if (not desc.get('event_source_mapping')):
  ret['comment'] = 'Event source mapping does not exist.'
  return ret
 ret['name'] = desc['event_source_mapping']['UUID']
 if __opts__['test']:
  ret['comment'] = 'Event source mapping is set to be removed.'
  ret['result'] = None
  return ret
 r = __salt__['boto_lambda.delete_event_source_mapping'](EventSourceArn=EventSourceArn, FunctionName=FunctionName, region=region, key=key, keyid=keyid, profile=profile)
 if (not r['deleted']):
  ret['result'] = False
  ret['comment'] = 'Failed to delete event source mapping: {0}.'.format(r['error']['message'])
  return ret
 ret['changes']['old'] = desc
 ret['changes']['new'] = {'event_source_mapping': None}
 ret['comment'] = 'Event source mapping deleted.'
 return ret

def event_source_mapping_absent ( name , EventSourceArn , FunctionName , region = None , key = None , keyid = None , profile = None ) : ret = { 'name' : None , 'result' : True , 'comment' : '' , 'changes' : { } } desc = __salt__ [ 'boto_lambda.describe_event_source_mapping' ] ( EventSourceArn = EventSourceArn , FunctionName = FunctionName , region = region , key = key , keyid = keyid , profile = profile ) if ( 'error' in desc ) : ret [ 'result' ] = False ret [ 'comment' ] = 'Failed to delete event source mapping: {0}.' . format ( desc [ 'error' ] [ 'message' ] ) return ret if ( not desc . get ( 'event_source_mapping' ) ) : ret [ 'comment' ] = 'Event source mapping does not exist.' return ret ret [ 'name' ] = desc [ 'event_source_mapping' ] [ 'UUID' ] if __opts__ [ 'test' ] : ret [ 'comment' ] = 'Event source mapping is set to be removed.' ret [ 'result' ] = None return ret r = __salt__ [ 'boto_lambda.delete_event_source_mapping' ] ( EventSourceArn = EventSourceArn , FunctionName = FunctionName , region = region , key = key , keyid = keyid , profile = profile ) if ( not r [ 'deleted' ] ) : ret [ 'result' ] = False ret [ 'comment' ] = 'Failed to delete event source mapping: {0}.' . format ( r [ 'error' ] [ 'message' ] ) return ret ret [ 'changes' ] [ 'old' ] = desc ret [ 'changes' ] [ 'new' ] = { 'event_source_mapping' : None } ret [ 'comment' ] = 'Event source mapping deleted.' return ret
ensure event source mapping with passed properties is absent .