def add_source(name, source_location, username=None, password=None):
 choc_path = _find_chocolatey(__context__, __salt__)
 cmd = [choc_path, 'sources', 'add', '--name', name, '--source', source_location]
 if username:
  cmd.extend(['--user', username])
 if password:
  cmd.extend(['--password', password])
 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 add_source ( name , source_location , username = None , password = None ) : choc_path = _find_chocolatey ( __context__ , __salt__ ) cmd = [ choc_path , 'sources' , 'add' , '--name' , name , '--source' , source_location ] if username : cmd . extend ( [ '--user' , username ] ) if password : cmd . extend ( [ '--password' , password ] ) 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' ]
bind a source to a zone .