fix: enqueue failure value must be byte string

encodes item to string before sending it back to the queue.

Change-Id: I2ef1f586bcdaf9a67a7860dcc9b1b2983ad5f4e5
This commit is contained in:
Isaac Mungai 2016-08-04 14:53:27 -04:00
parent 1598779ab7
commit e6d866d79e
4 changed files with 16 additions and 9 deletions

View File

@ -28,7 +28,7 @@ class ServicesControllerBase(controller.DistributedTaskControllerBase):
def __init__(self, driver):
super(ServicesControllerBase, self).__init__(driver)
def submit_task(self):
def submit_task(self, flow_factory, **kwargs):
"""submit a task .
:raises NotImplementedError

View File

@ -196,7 +196,10 @@ class DefaultSSLCertificateController(base.SSLCertificateController):
'validate_service to False to retry this san-retry '
'request forcefully'.format(r['domain_name'], r)
)
elif service_obj.operator_status.lower() == 'disabled':
elif (
service_obj is not None and
service_obj.operator_status.lower() == 'disabled'
):
err_state = True
LOG.error(
u'The service for domain {0} is disabled.'

View File

@ -97,14 +97,18 @@ class CheckCertStatusTask(task.Task):
return "cancelled"
else:
LOG.info(
"SPS Not completed for {0}. "
"SPS Not completed for domain {0}, san_cert {1}. "
"Found status {2}. "
"Returning certificate object to Queue.".format(
cert_obj.get_san_edge_name()
cert_obj.domain_name,
cert_obj.get_san_edge_name(),
status
)
)
# convert cert_obj_json from unicode -> string
# before enqueue
self.akamai_driver.san_mapping_queue.enqueue_san_mapping(
cert_obj_json
)
json.dumps(cert_obj.to_dict()))
return ""

View File

@ -33,18 +33,18 @@ class ModSanQueue(object):
def __init__(self, conf):
self._conf = conf
def enqueue_mod_san_request(self, domain_name):
def enqueue_mod_san_request(self, cert_obj_json):
raise NotImplementedError
def dequeue_mod_san_request(self):
raise NotImplementedError
def traverse_queue(self):
'''Travese queue and return all items on the queue in a list'''
"""Traverse queue and return all items on the queue in a list."""
raise NotImplementedError
def put_queue_data(self, queue_data_list):
'''Juggling and put new queue data list in the queue'''
"""Juggling and put new queue data list in the queue."""
raise NotImplementedError
def move_request_to_top(self):