def get_data(self): try: jobs = saharaclient.job_list(self.request) except Exception: jobs = [] exceptions.handle(self.request, _("Unable to fetch jobs.")) return jobs
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
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.")) return jobs