Make project_id optional for background job

of type akamai_check_and_update_cert_status

Change-Id: I972052c89de17d5c857dd4900d762dfb280c8bc9
This commit is contained in:
Isaac Mungai 2016-08-02 10:39:32 -04:00
parent b76d981a24
commit 1598779ab7
2 changed files with 8 additions and 6 deletions

View File

@ -54,9 +54,10 @@ class BackgroundJobController(base.BackgroundJobController):
consume=True consume=True
) )
for cert_dict in queue_data: for cert in queue_data:
cert_dict = dict()
try: try:
cert_dict = json.loads(cert_dict) cert_dict = json.loads(cert)
LOG.info( LOG.info(
'Starting to check status on domain: {0},' 'Starting to check status on domain: {0},'
'for project_id: {1}' 'for project_id: {1}'
@ -69,7 +70,7 @@ class BackgroundJobController(base.BackgroundJobController):
) )
t_kwargs = { t_kwargs = {
"cert_obj_json": json.dumps(cert_dict), "cert_obj_json": json.dumps(cert_dict),
"project_id": kwargs.get("project_id") "project_id": cert_dict.get("project_id")
} }
self.distributed_task_controller.submit_task( self.distributed_task_controller.submit_task(
check_cert_status_and_update_flow. check_cert_status_and_update_flow.
@ -99,9 +100,10 @@ class BackgroundJobController(base.BackgroundJobController):
cname_host_info_list = [] cname_host_info_list = []
for cert_dict in queue_data: for cert in queue_data:
cert_dict = dict()
try: try:
cert_dict = json.loads(cert_dict) cert_dict = json.loads(cert)
domain_name = cert_dict["domain_name"] domain_name = cert_dict["domain_name"]
san_cert = ( san_cert = (

View File

@ -33,7 +33,7 @@ class BackgroundJobSchema(schema_base.SchemaBase):
}, },
'project_id': { 'project_id': {
'type': 'string', 'type': 'string',
'required': True 'required': False
} }
} }
}, },