1
0
mirror of https://github.com/haiwen/ccnet-server.git synced 2025-08-02 05:13:32 +00:00

Fix reading port in ccnet python module.

On linux we have already made the PORT conf optional.
This commit is contained in:
Shuai Lin 2016-09-13 11:16:37 +08:00
parent 52c52a63d5
commit efa16dd335

View File

@ -91,7 +91,10 @@ class Client(object):
def parse_config(self):
self.config = ConfigParser.ConfigParser()
self.config.read(self.config_file)
self.port = self.config.getint('Client', 'PORT')
if self.config.has_option('Client', 'PORT'):
self.port = self.config.getint('Client', 'PORT')
else:
self.port = 10001
self.un_path = ''
if self.config.has_option('Client', 'UNIX_SOCKET'):
self.un_path = self.config.get('Client', 'UNIX_SOCKET')