Beispiel #1
0
    def get_entity(self, name, settings):
        #if name is None:
        #    name = self._uri

        classes = self._data.get('classes')
        if classes is None:
            classes = []
        classes = datatypes.Classes(classes)

        applications = self._data.get('applications')
        if applications is None:
            applications = []
        applications = datatypes.Applications(applications)

        parameters = self._data.get('parameters')
        if parameters is None:
            parameters = {}
        parameters = datatypes.Parameters(parameters, settings, self._uri)

        exports = self._data.get('exports')
        if exports is None:
            exports = {}
        exports = datatypes.Exports(exports, settings, self._uri)

        env = self._data.get('environment', None)

        return datatypes.Entity(settings,
                                classes=classes,
                                applications=applications,
                                parameters=parameters,
                                exports=exports,
                                name=name,
                                environment=env,
                                uri=self.uri)
Beispiel #2
0
    def get_entity(self, name=None, default_environment=None):
        classes = self._data.get('classes')
        if classes is None:
            classes = []
        classes = datatypes.Classes(classes)

        applications = self._data.get('applications')
        if applications is None:
            applications = []
        applications = datatypes.Applications(applications)

        parameters = self._data.get('parameters')
        if parameters is None:
            parameters = {}
        parameters = datatypes.Parameters(parameters)

        mutators = self._data.get('mutators')
        if mutators is None:
            mutators = []
        mutators = datatypes.Mutators(datatypes.Mutators.load_callables(mutators))

        env = self._data.get('environment', default_environment)

        if name is None:
            name = self._path

        return datatypes.Entity(classes, applications, parameters,
                                name=name, environment=env,
                                uri='yaml_fs://{0}'.format(self._path),
                                mutators=mutators)
Beispiel #3
0
    def get_entity(self, name=None, default_environment=None):

        self.load_data(name)

        classes = self._data.get('classes')
        if classes is None:
            classes = []
        classes = datatypes.Classes(classes)

        applications = self._data.get('applications')
        if applications is None:
            applications = []
        applications = datatypes.Applications(applications)

        parameters = self._data.get('parameters')
        if parameters is None:
            parameters = {}
        parameters = datatypes.Parameters(parameters)

        env = self._data.get('environment', default_environment)

        if name is None:
            name = self._path

        return datatypes.Entity(classes,
                                applications,
                                parameters,
                                name=name,
                                environment=env,
                                uri='remote_fs://{0}'.format(name))
Beispiel #4
0
    def _get_entity(self):
        classes = self._data.get('classes')
        if classes is None:
            classes = []
        classes = datatypes.Classes(classes)

        applications = self._data.get('applications')
        if applications is None:
            applications = []
        applications = datatypes.Applications(applications)

        parameters = self._data.get('parameters')
        if parameters is None:
            parameters = {}
        parameters = datatypes.Parameters(parameters)

        return datatypes.Entity(classes,
                                applications,
                                parameters,
                                name=os.path.basename(self._path))