def _check_and_install_python(ret, python, default=False, user=None):
 ret = _python_installed(ret, python, user=user)
 if (not ret['result']):
  if __salt__['pyenv.install_python'](python, runas=user):
   ret['result'] = True
   ret['changes'][python] = 'Installed'
   ret['comment'] = 'Successfully installed python'
   ret['default'] = default
  else:
   ret['result'] = False
   ret['comment'] = 'Could not install python.'
   return ret
 if default:
  __salt__['pyenv.default'](python, runas=user)
 return ret

def _check_and_install_python ( ret , python , default = False , user = None ) : ret = _python_installed ( ret , python , user = user ) if ( not ret [ 'result' ] ) : if __salt__ [ 'pyenv.install_python' ] ( python , runas = user ) : ret [ 'result' ] = True ret [ 'changes' ] [ python ] = 'Installed' ret [ 'comment' ] = 'Successfully installed python' ret [ 'default' ] = default else : ret [ 'result' ] = False ret [ 'comment' ] = 'Could not install python.' return ret if default : __salt__ [ 'pyenv.default' ] ( python , runas = user ) return ret
verify that python is installed .