fix cfg file lookup
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import sys
|
||||
import socket
|
||||
from glob import glob
|
||||
from select import select
|
||||
from serial import serial_for_url
|
||||
from subprocess import Popen, PIPE, check_output, call
|
||||
@ -193,5 +194,8 @@ class AcceptHandler:
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = ConfigParser()
|
||||
parser.read('/root/aputools/servercfg/%s.cfg' % socket.gethostname())
|
||||
cfgfiles = glob('/root/aputools/servercfg/%s_*.cfg' % socket.gethostname())
|
||||
if len(cfgfiles) != 1:
|
||||
raise ValueError('there must be one and only one single cfgfile %r' % cfgfiles)
|
||||
parser.read(cfgfiles[0])
|
||||
AcceptHandler.run(parser['ROUTER'])
|
||||
|
Reference in New Issue
Block a user