=== modified file 'document_sftp/sftp_server/__init__.py' --- document_sftp/sftp_server/__init__.py 2010-02-25 17:02:45 +0000 +++ document_sftp/sftp_server/__init__.py 2010-02-25 17:25:44 +0000 @@ -30,9 +30,13 @@ from tools import config from tools.misc import detect_ip_addr - -HOST = '' -PORT = 8022 +if detect_ip_addr: + HOST = config.get('sftp_server_host', detect_ip_addr()) +else: + HOST = config.get('sftp_server_host', '127.0.0.1') + +PORT = int(config.get('sftp_server_port', '8022')) + privateKey = config['root_path'] + '/server.pkey' class sftp_server(ftpserver.ftp_server): @@ -43,8 +47,6 @@ def run(self): #paramiko.util.log_to_file('paramiko.log') # get host private key - HOST = config.get('ftp_server_address', detect_ip_addr()) - PORT = int(config.get('ftp_server_port', '8022')) host_key = paramiko.RSAKey(filename=privateKey) # bind the socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -74,7 +76,12 @@ pass raise -ds = sftp_server() -ds.start() +if HOST.lower() == 'none': + netsvc.Logger().notifyChannel("SFTP", netsvc.LOG_INFO, "\n Server SFTP Not Started\n") +else: + netsvc.Logger().notifyChannel("SFTP", netsvc.LOG_INFO, "\n Serving SFTP on %s:%s\n" % (HOST, PORT)) + ds = sftp_server() + ds.start() + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file