Ejemplo n.º 1
0
 def __init__(self,
              db_path=None,
              db_default_file=None,
              db_cache_path=None,
              con=None,
              dump_yaml_in_index=None,
              vonly=False):
     self.db_path = db_path or conf.get('db_path')
     self.db_default_file = db_default_file or conf.get('db_default_file')
     self.db_cache_path = db_cache_path or conf.get('db_cache_path')
     if vonly:
         return
     # Use a separate index for projects (same as for users) as mapping
     # name/type collision will occured as commits have dynamic mapping
     self.eprojects = EProjects(
         connector=(con or index.Connector(index_suffix='projects')))
     self.el_version = self.eprojects.es.info().get('version',
                                                    {}).get('number', '')
     if dump_yaml_in_index:
         YAMLDefinition.__init__(self, self.db_path, self.db_default_file,
                                 self.db_cache_path)
         issues = self.validate()
         if issues:
             raise RuntimeError(issues)
         self._enrich_projects()
         projects, rid2projects = self._flatten_projects()
         self.eprojects.load(projects, rid2projects)
Ejemplo n.º 2
0
 def __init__(self, db_path=None, db_default_file=None, vonly=False):
     YAMLDefinition.__init__(self, db_path, db_default_file)
     self.enriched_groups = False
     self.enriched_idents = False
     if not vonly:
         self._users = users.Users(
             index.Connector(index_suffix='users'))
Ejemplo n.º 3
0
 def validate(self):
     if not hasattr(self, 'data'):
         YAMLDefinition.__init__(self, self.db_path, self.db_default_file,
                                 self.db_cache_path)
     validation_issues = []
     tids, issues = self._validate_templates()
     validation_issues.extend(issues)
     issues = self._validate_projects(tids)
     validation_issues.extend(issues)
     return validation_issues
Ejemplo n.º 4
0
 def validate(self):
     if not hasattr(self, 'data'):
         YAMLDefinition.__init__(
             self, self.db_path, self.db_default_file, self.db_cache_path)
     validation_issues = []
     tids, issues = self._validate_templates()
     validation_issues.extend(issues)
     issues = self._validate_projects(tids)
     validation_issues.extend(issues)
     return validation_issues
Ejemplo n.º 5
0
 def __init__(self, db_path=None, db_default_file=None, vonly=False,
              db_cache_path=None):
     self.db_path = db_path or conf.get('db_path')
     self.db_default_file = db_default_file or conf.get('db_default_file')
     self.db_cache_path = db_cache_path or conf.get('db_cache_path')
     YAMLDefinition.__init__(
       self, self.db_path, self.db_default_file, self.db_cache_path)
     self.enriched_groups = False
     self.enriched_idents = False
     if not vonly:
         self._users = users.Users(
             index.Connector(index_suffix='users'))
Ejemplo n.º 6
0
 def __init__(self, db_path=None, db_default_file=None, db_cache_path=None,
              con=None, dump_yaml_in_index=None, vonly=False):
     self.db_path = db_path or conf.get('db_path')
     self.db_default_file = db_default_file or conf.get('db_default_file')
     self.db_cache_path = db_cache_path or conf.get('db_cache_path')
     if vonly:
         return
     # Use a separate index for projects (same as for users) as mapping
     # name/type collision will occured as commits have dynamic mapping
     self.eprojects = EProjects(
         connector=(con or index.Connector(index_suffix='projects')))
     self.el_version = self.eprojects.es.info().get(
         'version', {}).get('number', '')
     if dump_yaml_in_index:
         YAMLDefinition.__init__(
             self, self.db_path, self.db_default_file, self.db_cache_path)
         issues = self.validate()
         if issues:
             raise RuntimeError(issues)
         self._enrich_projects()
         projects, rid2projects = self._flatten_projects()
         self.eprojects.load(projects, rid2projects)
Ejemplo n.º 7
0
 def __init__(self, db_path=None, db_default_file=None):
     YAMLDefinition.__init__(self, db_path, db_default_file)
     self.enriched = False
     self.gitweb_lookup = {}
     self.flatten = {}
     self.ref2projects_lookup = {}