Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
fix: enqueue failure value must be byte string
Browse files Browse the repository at this point in the history
encodes item to string before sending it back to the queue.

Change-Id: I2ef1f586bcdaf9a67a7860dcc9b1b2983ad5f4e5
  • Loading branch information
isaacm committed Aug 4, 2016
1 parent 1598779 commit e6d866d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion poppy/distributed_task/base/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion poppy/manager/default/ssl_certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ def remove_duplicates(data):
'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.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,18 @@ def execute(self, cert_obj_json):
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 ""


Expand Down
6 changes: 3 additions & 3 deletions poppy/provider/akamai/mod_san_queue/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit e6d866d

Please sign in to comment.