def handle(self, request, context): try: extra = {} bin_url = "%s://%s" % (context["job_binary_type"], context["job_binary_url"]) if (context["job_binary_type"] == "swift"): extra = self.handle_swift(request, context) update_data = { "name": context["job_binary_name"], "description": context["job_binary_description"], "extra": extra, "url": bin_url, 'is_public': context['is_public'], 'is_protected': context['is_protected'] } bin_object = saharaclient.job_binary_update( request, self.initial["job_binary"].id, update_data) messages.success(request, "Successfully updated job binary") return bin_object except Exception: exceptions.handle(request, _("Unable to update job binary")) return False
def change_rule_method(self, request, datum_id, **update_kwargs): saharaclient.job_binary_update(request, datum_id, update_kwargs)