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
)
for cert_dict in queue_data:
for cert in queue_data:
cert_dict = dict()
try:
cert_dict = json.loads(cert_dict)
cert_dict = json.loads(cert)
LOG.info(
'Starting to check status on domain: {0},'
'for project_id: {1}'
@ -69,7 +70,7 @@ class BackgroundJobController(base.BackgroundJobController):
)
t_kwargs = {
"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(
check_cert_status_and_update_flow.
@ -99,9 +100,10 @@ class BackgroundJobController(base.BackgroundJobController):
cname_host_info_list = []
for cert_dict in queue_data:
for cert in queue_data:
cert_dict = dict()
try:
cert_dict = json.loads(cert_dict)
cert_dict = json.loads(cert)
domain_name = cert_dict["domain_name"]
san_cert = (

View File

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