def delete_pool_member(hostname, username, password, name, member):
 ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}
 if __opts__['test']:
  return _test_output(ret, 'delete', params={'hostname': hostname, 'username': username, 'password': password, 'name': name, 'members': member})
 existing = __salt__['bigip.list_pool'](hostname, username, password, name)
 if (existing['code'] == 200):
  current_members = existing['content']['membersReference']['items']
  exists = False
  for current_member in current_members:
   if (current_member['name'] == member):
    exists = True
    existing_member = current_member
    break
  if exists:
   deleted = __salt__['bigip.delete_pool_member'](hostname, username, password, name, member)
   if (deleted['code'] == 200):
    ret['result'] = True
    ret['comment'] = 'Pool Member: {member} was successfully deleted.'.format(member=member)
    ret['changes']['old'] = existing_member
    ret['changes']['new'] = {}
  else:
   ret['result'] = True
   ret['comment'] = 'This pool member already does not exist. No changes made.'
   ret['changes']['old'] = {}
   ret['changes']['new'] = {}
 else:
  ret = _load_result(existing, ret)
 return ret

def delete_pool_member ( hostname , username , password , name , member ) : ret = { 'name' : name , 'changes' : { } , 'result' : False , 'comment' : '' } if __opts__ [ 'test' ] : return _test_output ( ret , 'delete' , params = { 'hostname' : hostname , 'username' : username , 'password' : password , 'name' : name , 'members' : member } ) existing = __salt__ [ 'bigip.list_pool' ] ( hostname , username , password , name ) if ( existing [ 'code' ] == 200 ) : current_members = existing [ 'content' ] [ 'membersReference' ] [ 'items' ] exists = False for current_member in current_members : if ( current_member [ 'name' ] == member ) : exists = True existing_member = current_member break if exists : deleted = __salt__ [ 'bigip.delete_pool_member' ] ( hostname , username , password , name , member ) if ( deleted [ 'code' ] == 200 ) : ret [ 'result' ] = True ret [ 'comment' ] = 'Pool Member: {member} was successfully deleted.' . format ( member = member ) ret [ 'changes' ] [ 'old' ] = existing_member ret [ 'changes' ] [ 'new' ] = { } else : ret [ 'result' ] = True ret [ 'comment' ] = 'This pool member already does not exist. No changes made.' ret [ 'changes' ] [ 'old' ] = { } ret [ 'changes' ] [ 'new' ] = { } else : ret = _load_result ( existing , ret ) return ret
delete an existing pool member .