def _check_and_uninstall_python(ret, python, user=None):
 ret = _python_installed(ret, python, user=user)
 if ret['result']:
  if ret['default']:
   __salt__['pyenv.default']('system', runas=user)
  if __salt__['pyenv.uninstall_python'](python, runas=user):
   ret['result'] = True
   ret['changes'][python] = 'Uninstalled'
   ret['comment'] = 'Successfully removed python'
   return ret
  else:
   ret['result'] = False
   ret['comment'] = 'Failed to uninstall python'
   return ret
 else:
  ret['result'] = True
  ret['comment'] = 'python {0} is already absent'.format(python)
 return ret

def _check_and_uninstall_python ( ret , python , user = None ) : ret = _python_installed ( ret , python , user = user ) if ret [ 'result' ] : if ret [ 'default' ] : __salt__ [ 'pyenv.default' ] ( 'system' , runas = user ) if __salt__ [ 'pyenv.uninstall_python' ] ( python , runas = user ) : ret [ 'result' ] = True ret [ 'changes' ] [ python ] = 'Uninstalled' ret [ 'comment' ] = 'Successfully removed python' return ret else : ret [ 'result' ] = False ret [ 'comment' ] = 'Failed to uninstall python' return ret else : ret [ 'result' ] = True ret [ 'comment' ] = 'python {0} is already absent' . format ( python ) return ret
verify that python is uninstalled .