def install_missing(name, version=None, source=None):
 choc_path = _find_chocolatey(__context__, __salt__)
 if (_LooseVersion(chocolatey_version()) >= _LooseVersion('0.9.8.24')):
  log.warning('installmissing is deprecated, using install')
  return install(name, version=version)
 cmd = [choc_path, 'installmissing', name]
 if version:
  cmd.extend(['--version', version])
 if source:
  cmd.extend(['--source', source])
 cmd.extend(_yes(__context__))
 result = __salt__['cmd.run_all'](cmd, python_shell=False)
 if (result['retcode'] != 0):
  err = 'Running chocolatey failed: {0}'.format(result['stdout'])
  raise CommandExecutionError(err)
 return result['stdout']

def install_missing ( name , version = None , source = None ) : choc_path = _find_chocolatey ( __context__ , __salt__ ) if ( _LooseVersion ( chocolatey_version ( ) ) >= _LooseVersion ( '0.9.8.24' ) ) : log . warning ( 'installmissing is deprecated, using install' ) return install ( name , version = version ) cmd = [ choc_path , 'installmissing' , name ] if version : cmd . extend ( [ '--version' , version ] ) if source : cmd . extend ( [ '--source' , source ] ) cmd . extend ( _yes ( __context__ ) ) result = __salt__ [ 'cmd.run_all' ] ( cmd , python_shell = False ) if ( result [ 'retcode' ] != 0 ) : err = 'Running chocolatey failed: {0}' . format ( result [ 'stdout' ] ) raise CommandExecutionError ( err ) return result [ 'stdout' ]
instructs chocolatey to install a package if it doesnt already exist .