示例#1
0
文件: data.py 项目: Toaster192/kpet
    def __init__(self, dir_path):
        """
        Initialize a database object.
        """
        assert self.is_dir_valid(dir_path)

        super().__init__(
            ScopedYAMLFile(
                Struct(required=dict(),
                       optional=dict(suites=List(YAMLFile(Class(Suite))),
                                     trees=Dict(String()),
                                     arches=List(String()),
                                     host_types=Dict(Class(HostType)),
                                     host_type_regex=Regex(),
                                     recipesets=Dict(List(String()))))),
            dir_path + "/index.yaml")

        self.dir_path = dir_path
        if self.trees is None:
            self.trees = {}
        if self.arches is None:
            # TODO Switch to an empty list once database has these added
            self.arches = "x86_64 ppc64 ppc64le aarch64 s390x".split(" ")
        if self.suites is None:
            self.suites = []
示例#2
0
 def __init__(self, data):
     super().__init__(
         Struct(required=dict(name=String(), ),
                optional=dict(
                    host_type_regex=Regex(),
                    ignore_panic=Boolean(),
                    specific=Boolean(),
                    hostRequires=String(),
                    partitions=String(),
                    kickstart=String(),
                    tasks=String(),
                )), data)
示例#3
0
文件: data.py 项目: Toaster192/kpet
 def __init__(self, data):
     """
     Initialize a host type.
     """
     super().__init__(
         Struct(optional=dict(
             ignore_panic=Boolean(),
             hostRequires=String(),
             partitions=String(),
             kickstart=String(),
             tasks=String(),
         )), data)
示例#4
0
文件: data.py 项目: Toaster192/kpet
 def __init__(self, data):
     super().__init__(
         Struct(required=dict(name=String(), ),
                optional=dict(
                    host_type_regex=Regex(),
                    ignore_panic=Boolean(),
                    hostRequires=String(),
                    partitions=String(),
                    kickstart=String(),
                    tasks=String(),
                    match=Class(PositivePattern),
                    dont_match=Class(NegativePattern),
                    waived=Boolean(),
                    role=String(),
                    url_suffix=String(),
                    task_params=Dict(String()),
                )), data)
     if self.match is None:
         self.match = PositivePattern({})
     if self.dont_match is None:
         self.dont_match = NegativePattern({})
     if self.task_params is None:
         self.task_params = {}
     if self.role is None:
         self.role = 'STANDALONE'
示例#5
0
 def __init__(self, data):
     super().__init__(
         StrictStruct(description=String(),
                      version=String(),
                      patterns=List(
                          StrictStruct(pattern=Regex(),
                                       testcase_name=String())),
                      cases=List(
                          Struct(required=dict(name=String(),
                                               tasks=String()),
                                 optional=dict(hostRequires=String(),
                                               partitions=String(),
                                               kickstart=String())))), data)
示例#6
0
 def __init__(self, data):
     super().__init__(
         Struct(required=dict(description=String(),
                              patterns=List(
                                  StrictStruct(pattern=Regex(),
                                               case_name=String())),
                              cases=List(Class(Case))),
                optional=dict(host_type_regex=Regex(),
                              tasks=String(),
                              ignore_panic=Boolean(),
                              specific=Boolean(),
                              hostRequires=String(),
                              partitions=String(),
                              kickstart=String())), data)
示例#7
0
文件: data.py 项目: Toaster192/kpet
    def __init__(self, data):

        super().__init__(
            Struct(required=dict(description=String(),
                                 cases=List(Class(Case))),
                   optional=dict(host_type_regex=Regex(),
                                 tasks=String(),
                                 ignore_panic=Boolean(),
                                 hostRequires=String(),
                                 partitions=String(),
                                 kickstart=String(),
                                 match=Class(PositivePattern),
                                 dont_match=Class(NegativePattern),
                                 url_suffix=String(),
                                 maintainers=NonEmptyList(String()))), data)
        if self.match is None:
            self.match = PositivePattern({})
        if self.dont_match is None:
            self.dont_match = NegativePattern({})
示例#8
0
    def __init__(self, dir_path):
        """
        Initialize a database object.
        """
        assert self.is_dir_valid(dir_path)

        super().__init__(
            ScopedYAMLFile(
                Struct(required=dict(),
                       optional=dict(suites=List(YAMLFile(Class(Suite))),
                                     trees=Dict(String()),
                                     specific=Boolean(),
                                     host_types=Dict(Class(HostType)),
                                     host_type_regex=Regex()))),
            dir_path + "/index.yaml")

        self.dir_path = dir_path
        if self.trees is None:
            self.trees = {}
        if self.suites is None:
            self.suites = []