Skip to content

Commit

Permalink
Disable warning for registercloudguest and SMT class
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusbv committed May 14, 2024
1 parent f4a141b commit f0310d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/cloudregister/registerutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
REGISTERED_SMT_SERVER_DATA_FILE_NAME = 'currentSMTInfo.obj'
RMT_AS_SCC_PROXY_MARKER = 'rmt_is_scc_proxy'

requests.packages.urllib3.disable_warnings(
requests.packages.urllib3.exceptions.InsecureRequestWarning
)


# ----------------------------------------------------------------------------
def add_hosts_entry(smt_server):
Expand Down
7 changes: 4 additions & 3 deletions lib/cloudregister/smt.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def __init__(self, smtXMLNode, https_only=False):
if https_only:
self._protocol = 'https'
self._check_urls = self._form_srv_check_urls()
requests.packages.urllib3.disable_warnings(
requests.packages.urllib3.exceptions.InsecureRequestWarning
)


# --------------------------------------------------------------------
def __eq__(self, other_smt):
Expand Down Expand Up @@ -151,9 +155,6 @@ def is_responsive(self):

# disable InsecureRequestWarning
# as verification is disabled for the https request
requests.packages.urllib3.disable_warnings(
requests.packages.urllib3.exceptions.InsecureRequestWarning
)
for health_url in self._check_urls.keys():
try:
response = requests.get(health_url, timeout=2, verify=False)
Expand Down

0 comments on commit f0310d7

Please sign in to comment.