def ensure_views():
 options = _get_options(ret=None)
 _response = _request('GET', ((options['url'] + options['db']) + '/_design/salt'))
 if ('error' in _response):
  return set_salt_view()
 for view in get_valid_salt_views():
  if (view not in _response['views']):
   return set_salt_view()
 return True

def ensure_views ( ) : options = _get_options ( ret = None ) _response = _request ( 'GET' , ( ( options [ 'url' ] + options [ 'db' ] ) + '/_design/salt' ) ) if ( 'error' in _response ) : return set_salt_view ( ) for view in get_valid_salt_views ( ) : if ( view not in _response [ 'views' ] ) : return set_salt_view ( ) return True
this function makes sure that all the views that should exist in the design document do exist .