ScaleComputing / HyperCoreAnsibleCollection

Official Ansible collection for Scale Computing SC//HyperCore (HC3) v1 API
GNU General Public License v3.0
12 stars 8 forks source link

Ignore SSL protocol violation during certificate replacement #171

Closed justinc1 closed 1 year ago

justinc1 commented 1 year ago

@ddemlow had problem replacing certificate, and this happened only it server was access via VPN. Likely VPN resulted in just correct timing to raise unexpected SSL error - in python code we got "EOF occurred in violation of protocol (_ssl.c:997)".

PR catches ScaleComputingError exception, and checks if message had this particular message inside. I didn't try to refactor the ScaleComputingError to have a dedicated exception - I'm not able to reproduce the problem, so it is hard to test any code modification. For same reason, it is hard to add any integration test for this.

The extra module.warn were added, to help debugging if anything similar happens later. I hope warn message is kind enough ("... ignore and continue") - I do not want to make anyone nervous.

justinc1 commented 1 year ago

Refactored exception handling. We expect about 3 different ssl errors.

Integ test passed in https://github.com/ScaleComputing/HyperCoreAnsibleCollection/actions/runs/4479886132/jobs/7874449568