def set_salt_view():
 options = _get_options(ret=None)
 new_doc = {}
 new_doc['views'] = get_valid_salt_views()
 new_doc['language'] = 'javascript'
 _response = _request('PUT', ((options['url'] + options['db']) + '/_design/salt'), 'application/json', json.dumps(new_doc))
 if ('error' in _response):
  log.warning('Unable to set the salt design document: {0}'.format(_response['error']))
  return False
 return True

def set_salt_view ( ) : options = _get_options ( ret = None ) new_doc = { } new_doc [ 'views' ] = get_valid_salt_views ( ) new_doc [ 'language' ] = 'javascript' _response = _request ( 'PUT' , ( ( options [ 'url' ] + options [ 'db' ] ) + '/_design/salt' ) , 'application/json' , json . dumps ( new_doc ) ) if ( 'error' in _response ) : log . warning ( 'Unable to set the salt design document: {0}' . format ( _response [ 'error' ] ) ) return False return True
helper function that sets the salt design document .