예제 #1
0
    def handle(self, request, context):
        main_locations = []
        lib_locations = []

        for k in context.keys():
            if k.startswith('lib_'):
                lib_locations.append(context.get(k))

        if context.get("main_binary", None):
            main_locations.append(context["main_binary"])

        try:
            job = saharaclient.job_create(request, context["job_name"],
                                          context["job_type"], main_locations,
                                          lib_locations,
                                          context["job_description"])

            hlps = helpers.Helpers(request)
            if hlps.is_from_guide():
                request.session["guide_job_id"] = job.id
                request.session["guide_job_type"] = context["job_type"]
                request.session["guide_job_name"] = context["job_name"]
                self.success_url = (
                    "horizon:project:data_processing.wizard:jobex_guide")
            return True
        except Exception:
            exceptions.handle(request)
            return False
예제 #2
0
    def handle(self, request, context):
        main_locations = []
        lib_locations = []

        for k in context.keys():
            if k.startswith('lib_'):
                lib_locations.append(context.get(k))

        if context.get("main_binary", None):
            main_locations.append(context["main_binary"])

        try:
            job = saharaclient.job_create(
                request,
                context["job_name"],
                context["job_type"],
                main_locations,
                lib_locations,
                context["job_description"])

            hlps = helpers.Helpers(request)
            if hlps.is_from_guide():
                request.session["guide_job_id"] = job.id
                request.session["guide_job_type"] = context["job_type"]
                request.session["guide_job_name"] = context["job_name"]
                self.success_url = (
                    "horizon:project:data_processing.wizard:jobex_guide")
            return True
        except Exception:
            exceptions.handle(request)
            return False
예제 #3
0
    def handle(self, request, context):
        main_locations = []
        lib_locations = []

        for k in context.keys():
            if k.startswith('lib_'):
                lib_locations.append(context.get(k))

        if context.get("main_binary", None):
            main_locations.append(context["main_binary"])

        try:
            saharaclient.job_create(request, context["job_name"],
                                    context["job_type"], main_locations,
                                    lib_locations, context["job_description"])
            return True
        except Exception:
            exceptions.handle(request)
            return False
예제 #4
0
    def handle(self, request, context):
        main_locations = []
        lib_locations = []

        for k in context.keys():
            if k.startswith('lib_'):
                lib_locations.append(context.get(k))

        if context.get("main_binary", None):
            main_locations.append(context["main_binary"])

        try:
            saharaclient.job_create(
                request,
                context["job_name"],
                context["job_type"],
                main_locations,
                lib_locations,
                context["job_description"])
            return True
        except Exception:
            exceptions.handle(request)
            return False