예제 #1
0
    def load(self):
        meta = self._load_metadata()
        meta_parser = RoleMetaParser(meta, logger=self.log)
        galaxy_info = meta_parser.metadata

        meta_parser.validate_strings()

        # TODO: Refactoring required
        data = {}
        data.update(self._load_string_attrs(galaxy_info))

        container_yml_type, container_yml = self._load_container_yml()

        description = data.pop('description')

        data['role_type'] = self._get_role_type(galaxy_info,
                                                container_yml_type)
        data['tags'] = meta_parser.parse_tags()
        data['platforms'] = meta_parser.parse_platforms()
        data['cloud_platforms'] = meta_parser.parse_cloud_platforms()
        data['dependencies'] = meta_parser.parse_dependencies()
        data['video_links'] = meta_parser.parse_videos()
        readme = self._get_readme()

        name = galaxy_info.get('role_name', self.name)
        return models.Content(name=name,
                              original_name=self.name,
                              path=self.rel_path,
                              content_type=self.content_type,
                              description=description,
                              role_meta=data,
                              readme=readme,
                              metadata={
                                  'container_meta': container_yml,
                              })
예제 #2
0
 def load(self):
     readme = self._get_readme(os.path.dirname(self.path))
     return models.Content(
         name=self.name,
         path=self.rel_path,
         readme=readme,
         content_type=self.content_type,
     )
예제 #3
0
    def load(self):
        self._parse_plugin()

        description = ''
        if self.documentation:
            description = self.documentation.get('short_description', '')

        readme = self._get_readme(os.path.dirname(self.path))

        return models.Content(name=self.name,
                              description=description,
                              path=self.rel_path,
                              content_type=self.content_type,
                              readme=readme,
                              metadata={'documentation': self.documentation})
예제 #4
0
파일: role.py 프로젝트: RHMTT/galaxy-quick
    def load(self):
        meta_parser = self._get_meta_parser()
        galaxy_info = meta_parser.metadata
        original_name = self.name
        self.name = self._get_metadata_role_name(galaxy_info)

        tox_data = self._load_tox()
        meta_parser.set_tox(tox_data)

        meta_parser.validate_strings()

        # TODO: Refactoring required
        self.data.update(self._load_string_attrs(galaxy_info))

        container_yml_type, container_yml = self._load_container_yml()

        description = self.data.pop('description')

        self.data['role_type'] = self._get_role_type(
            galaxy_info, container_yml_type
        )
        self.data['tags'] = meta_parser.parse_tags()
        self.data['platforms'] = meta_parser.parse_platforms()
        self.data['cloud_platforms'] = meta_parser.parse_cloud_platforms()
        self.data['dependencies'] = meta_parser.parse_dependencies()
        self.data['video_links'] = meta_parser.parse_videos()
        # meta_parser.check_tox()
        readme = self._get_readme()

        self._check_tags()
        self._check_platforms()
        self._check_cloud_platforms()
        self._check_dependencies()

        return models.Content(
            name=self.name,
            original_name=original_name,
            path=self.rel_path,
            content_type=self.content_type,
            description=description,
            role_meta=self.data,
            readme=readme,
            metadata={
                'container_meta': container_yml,
            }
        )
예제 #5
0
    def load(self):
        self.log.info('Loading metadata file: {0}'.format(self.metadata_file))
        metadata = self._load_metadata()
        meta_parser = APBMetaParser(metadata, logger=self.log)
        name = meta_parser.parse_name()
        description = meta_parser.parse_description()
        meta_parser.check_data()
        data = {'tags': meta_parser.parse_tags()}
        readme = self._get_readme()

        return models.Content(
            name=name,
            path=self.rel_path,
            content_type=self.content_type,
            description=description,
            readme=readme,
            role_meta=data,
            metadata={
                'apb_metadata': metadata,
            },
        )