Exemplo n.º 1
0
        def load_script(path, content):
            try:
                json_object = json.loads(content)
                short_config = script_configs.read_short(path, json_object)

                if not conf_service._can_access_script(user, short_config):
                    return None

                return short_config
            except:
                LOGGER.exception('Could not load script: ' + path)
Exemplo n.º 2
0
        def find_and_load(path, content):
            try:
                json_object = json.loads(content)
                short_config = script_configs.read_short(path, json_object)
            except:
                LOGGER.exception('Could not load script config: ' + path)
                return None

            if short_config.name != name:
                return None

            raise StopIteration((short_config, path, json_object))