If device is not reachable from CVP, the node will be marked as non-compliant. When it's time to run validate_and_compare_configlets, CVP grabs the running configuration. Is the device is not reachable this throws a CvpApiError for the Post method.
We should handle this, alert in stdout and continue on.
Example of Exception that wasn't caught:
Traceback (most recent call last):
File "auto-reconcile.py", line 197, in
main()
File "auto-reconcile.py", line 179, in main
reconcile(cvp_client, device)
File "auto-reconcile.py", line 125, in reconcile
result = validate_and_compare_configlets(client, device_id, configlet_keys)
File "auto-reconcile.py", line 64, in validate_and_compare_configlets
data=body, timeout=client.api.request_timeout)
File "/usr/local/lib/python2.7/site-packages/cvprac/cvp_client.py", line 589, in post
return self._make_request('POST', url, timeout, data=data)
File "/usr/local/lib/python2.7/site-packages/cvprac/cvp_client.py", line 515, in _make_request
raise error
cvprac.cvp_client_errors.CvpApiError: POST: https://192.168.51.97:443/web/provisioning/v2/validateAndCompareConfiglets.do : Request Error: Device not reachable
If device is not reachable from CVP, the node will be marked as non-compliant. When it's time to run validate_and_compare_configlets, CVP grabs the running configuration. Is the device is not reachable this throws a CvpApiError for the Post method.
We should handle this, alert in stdout and continue on.
Example of Exception that wasn't caught:
Traceback (most recent call last): File "auto-reconcile.py", line 197, in
main()
File "auto-reconcile.py", line 179, in main
reconcile(cvp_client, device)
File "auto-reconcile.py", line 125, in reconcile
result = validate_and_compare_configlets(client, device_id, configlet_keys)
File "auto-reconcile.py", line 64, in validate_and_compare_configlets
data=body, timeout=client.api.request_timeout)
File "/usr/local/lib/python2.7/site-packages/cvprac/cvp_client.py", line 589, in post
return self._make_request('POST', url, timeout, data=data)
File "/usr/local/lib/python2.7/site-packages/cvprac/cvp_client.py", line 515, in _make_request
raise error
cvprac.cvp_client_errors.CvpApiError: POST: https://192.168.51.97:443/web/provisioning/v2/validateAndCompareConfiglets.do : Request Error: Device not reachable