-
Notifications
You must be signed in to change notification settings - Fork 8
[CDN-1176] Add fix to delete SNI certificate with domain name #31
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message is not pep8 compliance
) | ||
|
||
if found is False: | ||
if (cert_obj.cert_details["Akamai"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment what we are doing here. example(check if there is no pending changes in the enrolment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we removed the testcase for test_cert_delete_domain_exists_on_sni_certs
dont we need them anymore
|
||
certificate_controller = \ | ||
self._driver.manager.ssl_certificate_controller | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
existing implementation looks good. is it possible to use the existing implementation?
The endpoint to delete domain from SNI certificate was not supported for sni, this fix adds the support. poppy/distributed_task/taskflow/task/delete_ssl_certificate_tasks.py Removed flavor_id as cert_obj_json will contain all cert information. poppy/provider/akamai/certificates.py If domain is not found on certificate, we need to check pending change in progress and skip it if found; moved changes to appropriate part of the code. poppy/transport/pecan/controllers/v1/ssl_certificates.py Deletion of domain was hardcoded to san, and now has been accommodated for any type of cert value by accepting the request body instead. tests/unit/distributed_task/taskflow/test_flows.py Changed variables respective to changes in code. tests/unit/provider/akamai/test_certificates.py Deleted a duplicate test. Added cert details to pending changes, as it contains change url.
helpers.is_valid_domain_by_name(), | ||
helpers.abort_with_message) | ||
) | ||
def delete(self, domain_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be:
def delete(self, domain_name):
certificate_controller = \
self._driver.manager.ssl_certificate_controller
try:
# NOTE(TheSriram): we can also enforce project_id constraints
cert_obj = certificate_controller.get_certs_info_by_domain(
domain_name=domain_name,
project_id=None)
except ValueError:
pecan.abort(404, detail='certificate '
'could not be found '
'for domain : %s' %
domain_name)
raise
try:
certificate_controller.delete_ssl_certificate(
cert_obj.project_id, domain_name, cert_obj.cert_type
)
except ValueError as e:
pecan.abort(400, detail='Delete ssl certificate failed. '
'Reason: %s' % str(e))
return pecan.Response(None, 202)
@pecan.expose('json')
@decorators.validate(
domain_name=rule.Rule(
helpers.is_valid_domain_by_name(),
helpers.abort_with_message)
)
CDN-1176
poppy/distributed_task/taskflow/task/delete_ssl_certificate_tasks.py
Removed flavor_id as cert_obj_json will contain all cert information.
poppy/provider/akamai/certificates.py b/poppy/provider/akamai/certificates.py
If domain is not found on certificate, we need to check pending change in progress and skip it if found; moved changes to appropriate part of the code.
poppy/transport/pecan/controllers/v1/ssl_certificates.py
Deletion of domain was hardcoded to san, and now has been accommodated for any type of cert value by accepting the request body instead.
tests/unit/distributed_task/taskflow/test_flows.py b/tests/unit/distributed_task/taskflow/test_flows.py
Changed variables respective to changes in code.
tests/unit/provider/akamai/test_certificates.py b/tests/unit/provider/akamai/test_certificates.py
Deleted a duplicate test.
Added cert details to pending changes, as it contains change url.