From efa16dd3359bed0f4ef66a67a558620357c21ee0 Mon Sep 17 00:00:00 2001 From: Shuai Lin Date: Tue, 13 Sep 2016 11:16:37 +0800 Subject: [PATCH] Fix reading port in ccnet python module. On linux we have already made the PORT conf optional. --- python/ccnet/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/ccnet/client.py b/python/ccnet/client.py index e4d2e4e..1c57c68 100644 --- a/python/ccnet/client.py +++ b/python/ccnet/client.py @@ -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')