Skip to content

Commit 668c05a

Browse files
committed
Pulled insecure message into a constant variable
1 parent 832d9aa commit 668c05a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

stackdio/client/http.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727

2828
logger = logging.getLogger(__name__)
2929

30+
HTTP_INSECURE_MESSAGE = "\n".join([
31+
"You have chosen not to verify ssl connections.",
32+
"This is insecure, but it's your choice.",
33+
"This has been your single warning."])
34+
3035

3136
def use_admin_auth(func):
3237

@@ -110,13 +115,9 @@ def __init__(self, auth=None, verify=True):
110115

111116
if not verify:
112117
if self._http_log.handlers:
113-
self._http_log.warn("You have chosen not to verify ssl connections.")
114-
self._http_log.warn("This is insecure, but it's your choice.")
115-
self._http_log.warn("This has been your single warning.")
118+
self._http_log.warn(HTTP_INSECURE_MESSAGE)
116119
else:
117-
print("You have chosen not to verify ssl connections.")
118-
print("This is insecure, but it's your choice.")
119-
print("This has been your single warning.")
120+
print(HTTP_INSECURE_MESSAGE)
120121

121122
from requests.packages.urllib3 import disable_warnings
122123
disable_warnings()

0 commit comments

Comments
 (0)