Esempio n. 1
0
    def __init__(self, descriptor, path, artifact_dir):
        self._artifact_dir = artifact_dir
        self.path = path
        self.schema = get_image_schema().copy()
        # calling Descriptor constructor only here (we don't want Image() to mess with schema)
        super(Image, self).__init__(descriptor)
        self.skip_merging = ['description',
                             'version',
                             'name',
                             'release',
                             'help']

        self._prepare()
        self.name = self._descriptor['name']
        self._descriptor['execute'] = [Execute(x, self.name)
                                       for x in self._descriptor.get('execute', [])]
Esempio n. 2
0
import cekit

from cekit.descriptor import Image, ExecuteContainer
from cekit.descriptor.image import get_image_schema

module_schema = get_image_schema()
module_schema['map']['name'] = {'type': 'str'}
module_schema['map']['version'] = {'type': 'text'}
module_schema['map']['execute'] = {'type': 'any'}


class Module(Image):
    """Represents a module.

    Constructor arguments:
    descriptor_path: A path to module descriptor file.
    """
    def __init__(self, descriptor, path, artifact_dir):
        self._artifact_dir = artifact_dir
        self.path = path
        schema = module_schema.copy()
        self.schemas = [schema]
        # calling Descriptor constructor only here (we dont wat Image() to mess with schema)
        super(Image, self).__init__(descriptor)
        self.skip_merging = ['description', 'version', 'name', 'release']

        self._prepare()
        self.name = self._descriptor['name']
        self._descriptor['execute'] = ExecuteContainer(
            self._descriptor.get('execute', []), self.name)
Esempio n. 3
0
from cekit.descriptor import Image
from cekit.descriptor.image import get_image_schema

overrides_schema = get_image_schema()
overrides_schema['map']['name'] = {'type': 'str'}
overrides_schema['map']['version'] = {'type': 'text'}


class Overrides(Image):
    def __init__(self, descriptor, artifact_dir):
        self._artifact_dir = artifact_dir
        self.path = artifact_dir
        schema = overrides_schema.copy()
        self.schema = schema
        # calling Descriptor constructor only here (we dont wat Image() to mess with schema)
        super(Image, self).__init__(descriptor)

        self._prepare()