def key_absent(name, region=None, key=None, keyid=None, profile=None):
 ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
 exists = __salt__['boto_ec2.get_key'](name, region, key, keyid, profile)
 if exists:
  if __opts__['test']:
   ret['comment'] = 'The key {0} is set to be deleted.'.format(name)
   ret['result'] = None
   return ret
  deleted = __salt__['boto_ec2.delete_key'](name, region, key, keyid, profile)
  log.debug('exists is {0}'.format(deleted))
  if deleted:
   ret['result'] = True
   ret['comment'] = 'The key {0} is deleted.'.format(name)
   ret['changes']['old'] = name
  else:
   ret['result'] = False
   ret['comment'] = 'Could not delete key {0} '.format(name)
 else:
  ret['result'] = True
  ret['comment'] = 'The key name {0} does not exist'.format(name)
 return ret

def key_absent ( name , region = None , key = None , keyid = None , profile = None ) : ret = { 'name' : name , 'result' : True , 'comment' : '' , 'changes' : { } } exists = __salt__ [ 'boto_ec2.get_key' ] ( name , region , key , keyid , profile ) if exists : if __opts__ [ 'test' ] : ret [ 'comment' ] = 'The key {0} is set to be deleted.' . format ( name ) ret [ 'result' ] = None return ret deleted = __salt__ [ 'boto_ec2.delete_key' ] ( name , region , key , keyid , profile ) log . debug ( 'exists is {0}' . format ( deleted ) ) if deleted : ret [ 'result' ] = True ret [ 'comment' ] = 'The key {0} is deleted.' . format ( name ) ret [ 'changes' ] [ 'old' ] = name else : ret [ 'result' ] = False ret [ 'comment' ] = 'Could not delete key {0} ' . format ( name ) else : ret [ 'result' ] = True ret [ 'comment' ] = 'The key name {0} does not exist' . format ( name ) return ret
deletes a key pair .