This commit is contained in:
clowwindy 2015-08-11 17:55:16 +08:00
parent 7c08101ce8
commit a2bc6e1945
3 changed files with 19 additions and 9 deletions

View file

@ -84,7 +84,8 @@ def check_config(config, is_local):
sys.exit(2)
if not is_local and not config.get('password', None) \
and not config.get('port_password', None):
and not config.get('port_password', None) \
and not config.get('manager_address'):
logging.error('password or port_password not specified')
print_help(is_local)
sys.exit(2)
@ -92,7 +93,7 @@ def check_config(config, is_local):
if 'local_port' in config:
config['local_port'] = int(config['local_port'])
if 'server_port' in config and type(config['server_port']) != list:
if config.get('server_port', None) and type(config['server_port']) != list:
config['server_port'] = int(config['server_port'])
if config.get('local_address', '') in [b'0.0.0.0']:
@ -240,7 +241,7 @@ def get_config(is_local):
except Exception as e:
logging.error(e)
sys.exit(2)
config['server_port'] = config.get('server_port', 8388)
config['server_port'] = config.get('server_port', None)
logging.getLogger('').handlers = []
logging.addLevelName(VERBOSE_LEVEL, 'VERBOSE')