From 12208f4f2d7583e2539d2b9e9e12c9e799de678a Mon Sep 17 00:00:00 2001 From: Justin Hammond Date: Fri, 23 Sep 2016 11:57:10 -0500 Subject: [PATCH] Made sg updater elevate during job creation Change-Id: I232dca65c9be3427c95c300eaafaa84f401b40b7 JIRA:NCP-1172 --- quark/worker_plugins/sg_update_worker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quark/worker_plugins/sg_update_worker.py b/quark/worker_plugins/sg_update_worker.py index e6a57d5..703ce2a 100644 --- a/quark/worker_plugins/sg_update_worker.py +++ b/quark/worker_plugins/sg_update_worker.py @@ -78,7 +78,7 @@ class QuarkSGAsyncProcessCallback(object): resource_id=rule_id, tenant_id=db_sg['tenant_id']) job_body = dict(job=job_body) - job = job_api.create_job(context, job_body) + job = job_api.create_job(context.elevated(), job_body) rpc_client = QuarkSGAsyncProducerClient() try: rpc_client.populate_subtasks(context, sg, job['id']) @@ -135,7 +135,7 @@ class QuarkSGProducerCallback(object): resource_id=port['id'], parent_id=parent_job_id) job_body = dict(job=job_body) - job = job_api.create_job(context, job_body) + job = job_api.create_job(context.elevated(), job_body) rpc_consumer = QuarkSGAsyncConsumerClient() try: rpc_consumer.update_port(context, port['id'], job['id']) @@ -209,7 +209,7 @@ class QuarkSGConsumerCallback(object): portid, retries, error) update_body = dict(completed=True, status=status_str) update_body = dict(job=update_body) - job_api.update_job(context, jobid, update_body) + job_api.update_job(context.elevated(), jobid, update_body) class QuarkSGAsyncConsumer(base_worker.QuarkAsyncPluginBase):