def package_absent(m, name):
 retvals = {'rc': 0, 'stdout': '', 'stderr': ''}
 (name_install, name_remove, urls) = get_want_state(m, name, remove=True)
 if name_install:
  m.fail_json(msg="Can not combine '+' prefix with state=remove/absent.")
 if urls:
  m.fail_json(msg='Can not remove via URL.')
 if (m.params['type'] == 'patch'):
  m.fail_json(msg='Can not remove patches.')
 prerun_state = get_installed_state(m, name_remove)
 remove_version = [(p + name_remove[p]) for p in name_remove if name_remove[p]]
 name_remove = [p for p in name_remove if (p in prerun_state)]
 if ((not name_remove) and (not remove_version)):
  return (None, retvals)
 cmd = get_cmd(m, 'remove')
 cmd.extend(name_remove)
 cmd.extend(remove_version)
 retvals['cmd'] = cmd
 (result, retvals['rc'], retvals['stdout'], retvals['stderr']) = parse_zypper_xml(m, cmd)
 return (result, retvals)

def package_absent ( m , name ) : retvals = { 'rc' : 0 , 'stdout' : '' , 'stderr' : '' } ( name_install , name_remove , urls ) = get_want_state ( m , name , remove = True ) if name_install : m . fail_json ( msg = "Can not combine '+' prefix with state=remove/absent." ) if urls : m . fail_json ( msg = 'Can not remove via URL.' ) if ( m . params [ 'type' ] == 'patch' ) : m . fail_json ( msg = 'Can not remove patches.' ) prerun_state = get_installed_state ( m , name_remove ) remove_version = [ ( p + name_remove [ p ] ) for p in name_remove if name_remove [ p ] ] name_remove = [ p for p in name_remove if ( p in prerun_state ) ] if ( ( not name_remove ) and ( not remove_version ) ) : return ( None , retvals ) cmd = get_cmd ( m , 'remove' ) cmd . extend ( name_remove ) cmd . extend ( remove_version ) retvals [ 'cmd' ] = cmd ( result , retvals [ 'rc' ] , retvals [ 'stdout' ] , retvals [ 'stderr' ] ) = parse_zypper_xml ( m , cmd ) return ( result , retvals )
remove the packages in name .