def removed(name, requirements=None, bin_env=None, log=None, proxy=None, timeout=None, user=None, cwd=None, use_vt=False):
 ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}
 try:
  pip_list = __salt__['pip.list'](bin_env=bin_env, user=user, cwd=cwd)
 except (CommandExecutionError, CommandNotFoundError) as err:
  ret['result'] = False
  ret['comment'] = "Error uninstalling '{0}': {1}".format(name, err)
  return ret
 if (name not in pip_list):
  ret['result'] = True
  ret['comment'] = 'Package is not installed.'
  return ret
 if __opts__['test']:
  ret['result'] = None
  ret['comment'] = 'Package {0} is set to be removed'.format(name)
  return ret
 if __salt__['pip.uninstall'](pkgs=name, requirements=requirements, bin_env=bin_env, log=log, proxy=proxy, timeout=timeout, user=user, cwd=cwd, use_vt=use_vt):
  ret['result'] = True
  ret['changes'][name] = 'Removed'
  ret['comment'] = 'Package was successfully removed.'
 else:
  ret['result'] = False
  ret['comment'] = 'Could not remove package.'
 return ret

def removed ( name , requirements = None , bin_env = None , log = None , proxy = None , timeout = None , user = None , cwd = None , use_vt = False ) : ret = { 'name' : name , 'result' : None , 'comment' : '' , 'changes' : { } } try : pip_list = __salt__ [ 'pip.list' ] ( bin_env = bin_env , user = user , cwd = cwd ) except ( CommandExecutionError , CommandNotFoundError ) as err : ret [ 'result' ] = False ret [ 'comment' ] = "Error uninstalling '{0}': {1}" . format ( name , err ) return ret if ( name not in pip_list ) : ret [ 'result' ] = True ret [ 'comment' ] = 'Package is not installed.' return ret if __opts__ [ 'test' ] : ret [ 'result' ] = None ret [ 'comment' ] = 'Package {0} is set to be removed' . format ( name ) return ret if __salt__ [ 'pip.uninstall' ] ( pkgs = name , requirements = requirements , bin_env = bin_env , log = log , proxy = proxy , timeout = timeout , user = user , cwd = cwd , use_vt = use_vt ) : ret [ 'result' ] = True ret [ 'changes' ] [ name ] = 'Removed' ret [ 'comment' ] = 'Package was successfully removed.' else : ret [ 'result' ] = False ret [ 'comment' ] = 'Could not remove package.' return ret
make sure that a gem is not installed .