Update: BaseAPI class now has error handler

This commit is contained in:
2024-06-06 20:59:03 +09:00
parent cdf3a92527
commit f773898b71
2 changed files with 49 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
from requests.packages import urllib3
from mgrctl.settings.environment import env
from mgrctl.settings.platform import (
PLATFORM_TYPE,
PLATFORM_VERIFY_SSL,
@@ -26,6 +27,9 @@ API_HEADERS = {"Internal-Auth": "on", "Accept": "application/json"}
# Alias for import:
API_VERIFY_SSL = PLATFORM_VERIFY_SSL
# API 3004 Unavailable error handler:
API_COUNT_TRY_CONNECTIONS = env.int('API_COUNT_TRY_CONNECTIONS', 3)
# Suppress warning from urllib3:
if not PLATFORM_VERIFY_SSL_WARNING:
# ! This is not recommended,