Esempio n. 1
0
    def populate_job_choices(self, request):
        try:
            jobs = saharaclient.job_list(request)
        except Exception:
            jobs = []
            exceptions.handle(request, _("Unable to fetch jobs."))

        choices = [(job.id, job.name) for job in jobs]

        return choices
Esempio n. 2
0
    def populate_job_choices(self, request):
        try:
            jobs = saharaclient.job_list(request)
        except Exception:
            jobs = []
            exceptions.handle(request,
                              _("Unable to fetch jobs."))

        choices = [(job.id, job.name)
                   for job in jobs]

        return choices
Esempio n. 3
0
    def get_data(self):
        try:
            search_opts = {}
            filter = self.get_server_filter_info(self.request)
            if filter['value'] and filter['field']:
                search_opts = {filter['field']: filter['value']}
            jobs = saharaclient.job_list(self.request, search_opts)
        except Exception:
            jobs = []
            exceptions.handle(self.request, _("Unable to fetch jobs."))

        jobs = sorted(jobs, key=lambda job: job.created_at)
        return jobs
Esempio n. 4
0
    def get_data(self):
        try:
            search_opts = {}
            filter = self.get_server_filter_info(self.request)
            if filter['value'] and filter['field']:
                search_opts = {filter['field']: filter['value']}
            jobs = saharaclient.job_list(self.request, search_opts)
        except Exception:
            jobs = []
            exceptions.handle(self.request,
                              _("Unable to fetch jobs."))

        jobs = sorted(jobs, key=lambda job: job.created_at)
        return jobs