Work around py-cryptography deprecation warnings triggered by paramiko

parent b1c94293
......@@ -12,6 +12,7 @@ import logging
import logging.handlers
import csv
import re
import warnings
# Create log-object
......@@ -37,7 +38,10 @@ def storwize_connect(storwize_user, storwize_password, storwize_ip, storwize_por
try:
ssh_client = paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname=storwize_ip, username=storwize_user, password=storwize_password, port=22)
# Work around py-cryptography deprecation warnings triggered by paramiko
with warnings.catch_warnings():
warnings.filterwarnings(action='ignore', module='paramiko')
ssh_client.connect(hostname=storwize_ip, username=storwize_user, password=storwize_password, port=22)
storwize_logger.info("Connection Established Successfully")
return ssh_client
except Exception as oops:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment