Added custom port support for ftp access

This commit is contained in:
TheDudeFromCI 2021-08-03 03:00:23 -07:00 committed by GitHub
parent 2e459cafe2
commit 0c3bace49e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,9 +10,10 @@ from handlers.handle_config import configurationValues
def createFTPConnection():
configValues = configurationValues()
ftp = ftplib.FTP(configValues.sftp_server, user=configValues.sftp_user, \
passwd=configValues.sftp_password)
try:
ftp = ftplib.FTP()
ftp.connect(configValues.sftp_server, configValues.sftp_port)
ftp.login(configValues.sftp_user, configValues.sftp_password)
return ftp
except UnboundLocalError:
print(oColors.brightRed + "[FTP]: Check your config.ini!" + oColors.standardWhite)