Update cnos.py to remove unused method checkServerForImage (#27767)
This commit is contained in:
parent
1685338603
commit
52a8ed55ee
1 changed files with 2 additions and 37 deletions
|
@ -32,7 +32,6 @@
|
||||||
# Lenovo Networking
|
# Lenovo Networking
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import ftplib
|
|
||||||
import socket
|
import socket
|
||||||
import re
|
import re
|
||||||
try:
|
try:
|
||||||
|
@ -3089,41 +3088,7 @@ def doSecureImageTransfer(
|
||||||
return retVal
|
return retVal
|
||||||
# EOM
|
# EOM
|
||||||
|
|
||||||
# Method to find whether image is there in server or not
|
# Method for enter enable mnode
|
||||||
# This is not complete. Need to figure out How to do for SCP and SFTP
|
|
||||||
|
|
||||||
|
|
||||||
def checkServerForImage(protocol, ipaddress, folder, username, password):
|
|
||||||
# server = "10.241.105.214"
|
|
||||||
server = ipaddress
|
|
||||||
# username = "pbhosale"
|
|
||||||
username = username
|
|
||||||
# password = "Lab4man1"
|
|
||||||
password = password
|
|
||||||
imageDir = "cnos_images"
|
|
||||||
output = 0
|
|
||||||
try:
|
|
||||||
ftp = ftplib.FTP(server)
|
|
||||||
ftp.login(username, password)
|
|
||||||
except Exception:
|
|
||||||
# debugOutput e
|
|
||||||
return 1
|
|
||||||
else:
|
|
||||||
filelist = [] # to store all files
|
|
||||||
ftp.retrlines('NLST', filelist.append) # append to list
|
|
||||||
num = 0
|
|
||||||
for f in filelist:
|
|
||||||
# debugOutput f
|
|
||||||
if(f == imageDir):
|
|
||||||
num = 1
|
|
||||||
if(num == 0):
|
|
||||||
resp = ftp.mkd(imageDir)
|
|
||||||
if(resp != imageDir):
|
|
||||||
return 1
|
|
||||||
return output
|
|
||||||
# EOM
|
|
||||||
|
|
||||||
# Method for device response than time delay
|
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
@ -3179,7 +3144,7 @@ def enterEnableModeForDevice(enablePassword, timeout, obj):
|
||||||
return retVal
|
return retVal
|
||||||
# EOM
|
# EOM
|
||||||
|
|
||||||
# Method for device response than time delay
|
# Method for device response wait for a time delay
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue