static tgs work and various other tidying up
This commit is contained in:
parent
7b91306e36
commit
4cd3ce6780
111
bridge_master.py
111
bridge_master.py
@ -156,13 +156,13 @@ def make_bridges(_rules):
|
|||||||
return _rules
|
return _rules
|
||||||
|
|
||||||
#Make a single bridge - used for on-the-fly UA bridges
|
#Make a single bridge - used for on-the-fly UA bridges
|
||||||
def make_single_bridge(_tgid,_sourcesystem,_slot):
|
def make_single_bridge(_tgid,_sourcesystem,_slot,_tmout):
|
||||||
_tgid_s = str(int_id(_tgid))
|
_tgid_s = str(int_id(_tgid))
|
||||||
BRIDGES[_tgid_s] = []
|
BRIDGES[_tgid_s] = []
|
||||||
for _system in CONFIG['SYSTEMS']:
|
for _system in CONFIG['SYSTEMS']:
|
||||||
if _system != 'OBP-BM':
|
if _system != 'OBP-BM':
|
||||||
#if CONFIG['SYSTEMS'][system]['MODE'] == 'MASTER':
|
#if CONFIG['SYSTEMS'][system]['MODE'] == 'MASTER':
|
||||||
_tmout = CONFIG['SYSTEMS'][_system]['DEFAULT_UA_TIMER']
|
#_tmout = CONFIG['SYSTEMS'][_system]['DEFAULT_UA_TIMER']
|
||||||
if _system == _sourcesystem:
|
if _system == _sourcesystem:
|
||||||
if _slot == 1:
|
if _slot == 1:
|
||||||
BRIDGES[_tgid_s].append({'SYSTEM': _system, 'TS': 1, 'TGID': _tgid,'ACTIVE': True,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [],'ON': [_tgid,],'RESET': [], 'TIMER': time() +( _tmout * 60)})
|
BRIDGES[_tgid_s].append({'SYSTEM': _system, 'TS': 1, 'TGID': _tgid,'ACTIVE': True,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [],'ON': [_tgid,],'RESET': [], 'TIMER': time() +( _tmout * 60)})
|
||||||
@ -178,12 +178,12 @@ def make_single_bridge(_tgid,_sourcesystem,_slot):
|
|||||||
BRIDGES[_tgid_s].append({'SYSTEM': _system, 'TS': 1, 'TGID': _tgid,'ACTIVE': True,'TIMEOUT': '','TO_TYPE': 'NONE','OFF': [],'ON': [],'RESET': [], 'TIMER': time()})
|
BRIDGES[_tgid_s].append({'SYSTEM': _system, 'TS': 1, 'TGID': _tgid,'ACTIVE': True,'TIMEOUT': '','TO_TYPE': 'NONE','OFF': [],'ON': [],'RESET': [], 'TIMER': time()})
|
||||||
|
|
||||||
|
|
||||||
def make_default_reflector(reflector,system):
|
def make_default_reflector(reflector,_tmout,system):
|
||||||
bridge = '#'+str(reflector)
|
bridge = '#'+str(reflector)
|
||||||
_tmout = CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER']
|
#_tmout = CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER']
|
||||||
if bridge not in BRIDGES:
|
if bridge not in BRIDGES:
|
||||||
BRIDGES[bridge] = []
|
BRIDGES[bridge] = []
|
||||||
make_single_reflector(bytes_3(reflector), system)
|
make_single_reflector(bytes_3(reflector),_tmout, system)
|
||||||
bridgetemp = []
|
bridgetemp = []
|
||||||
for bridgesystem in BRIDGES[bridge]:
|
for bridgesystem in BRIDGES[bridge]:
|
||||||
if bridgesystem['SYSTEM'] == system and bridgesystem['TS'] == 2:
|
if bridgesystem['SYSTEM'] == system and bridgesystem['TS'] == 2:
|
||||||
@ -193,10 +193,10 @@ def make_default_reflector(reflector,system):
|
|||||||
|
|
||||||
BRIDGES[bridge] = bridgetemp
|
BRIDGES[bridge] = bridgetemp
|
||||||
|
|
||||||
def make_static_tg(tg,ts,system):
|
def make_static_tg(tg,ts,_tmout,system):
|
||||||
_tmout = CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER']
|
#_tmout = CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER']
|
||||||
if tg not in BRIDGES:
|
if str(tg) not in BRIDGES:
|
||||||
make_single_bridge(bytes_3(tg),system,ts)
|
make_single_bridge(bytes_3(tg),system,ts,_tmout)
|
||||||
bridgetemp = []
|
bridgetemp = []
|
||||||
for bridgesystem in BRIDGES[str(tg)]:
|
for bridgesystem in BRIDGES[str(tg)]:
|
||||||
if bridgesystem['SYSTEM'] == system and bridgesystem['TS'] == ts:
|
if bridgesystem['SYSTEM'] == system and bridgesystem['TS'] == ts:
|
||||||
@ -206,10 +206,8 @@ def make_static_tg(tg,ts,system):
|
|||||||
|
|
||||||
BRIDGES[str(tg)] = bridgetemp
|
BRIDGES[str(tg)] = bridgetemp
|
||||||
|
|
||||||
def reset_static_tg(tg,ts,system):
|
def reset_static_tg(tg,ts,_tmout,system):
|
||||||
_tmout = CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER']
|
#_tmout = CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER']
|
||||||
if tg not in BRIDGES:
|
|
||||||
make_single_bridge(bytes_3(tg),system,ts)
|
|
||||||
bridgetemp = []
|
bridgetemp = []
|
||||||
for bridgesystem in BRIDGES[str(tg)]:
|
for bridgesystem in BRIDGES[str(tg)]:
|
||||||
if bridgesystem['SYSTEM'] == system and bridgesystem['TS'] == ts:
|
if bridgesystem['SYSTEM'] == system and bridgesystem['TS'] == ts:
|
||||||
@ -219,12 +217,12 @@ def reset_static_tg(tg,ts,system):
|
|||||||
|
|
||||||
BRIDGES[str(tg)] = bridgetemp
|
BRIDGES[str(tg)] = bridgetemp
|
||||||
|
|
||||||
def reset_default_reflector(reflector,system):
|
def reset_default_reflector(reflector,_tmout,system):
|
||||||
bridge = '#'+str(reflector)
|
bridge = '#'+str(reflector)
|
||||||
_tmout = CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER']
|
#_tmout = CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER']
|
||||||
if bridge not in BRIDGES:
|
if bridge not in BRIDGES:
|
||||||
BRIDGES[bridge] = []
|
BRIDGES[bridge] = []
|
||||||
make_single_reflector(bytes_3(reflector), system)
|
make_single_reflector(bytes_3(reflector),_tmout, system)
|
||||||
bridgetemp = []
|
bridgetemp = []
|
||||||
for bridgesystem in BRIDGES[bridge]:
|
for bridgesystem in BRIDGES[bridge]:
|
||||||
if bridgesystem['SYSTEM'] == system and bridgesystem['TS'] == 2:
|
if bridgesystem['SYSTEM'] == system and bridgesystem['TS'] == 2:
|
||||||
@ -234,14 +232,14 @@ def reset_default_reflector(reflector,system):
|
|||||||
|
|
||||||
BRIDGES[bridge] = bridgetemp
|
BRIDGES[bridge] = bridgetemp
|
||||||
|
|
||||||
def make_single_reflector(_tgid,_sourcesystem):
|
def make_single_reflector(_tgid,_tmout,_sourcesystem):
|
||||||
_tgid_s = str(int_id(_tgid))
|
_tgid_s = str(int_id(_tgid))
|
||||||
_bridge = '#' + _tgid_s
|
_bridge = '#' + _tgid_s
|
||||||
BRIDGES[_bridge] = []
|
BRIDGES[_bridge] = []
|
||||||
for _system in CONFIG['SYSTEMS']:
|
for _system in CONFIG['SYSTEMS']:
|
||||||
if _system != 'OBP-BM':
|
if _system != 'OBP-BM':
|
||||||
#if CONFIG['SYSTEMS'][system]['MODE'] == 'MASTER':
|
#if CONFIG['SYSTEMS'][system]['MODE'] == 'MASTER':
|
||||||
_tmout = CONFIG['SYSTEMS'][_system]['DEFAULT_UA_TIMER']
|
#_tmout = CONFIG['SYSTEMS'][_system]['DEFAULT_UA_TIMER']
|
||||||
if _system == _sourcesystem:
|
if _system == _sourcesystem:
|
||||||
BRIDGES[_bridge].append({'SYSTEM': _system, 'TS': 2, 'TGID': bytes_3(9),'ACTIVE': True,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [],'ON': [_tgid,],'RESET': [], 'TIMER': time() + (_tmout * 60)})
|
BRIDGES[_bridge].append({'SYSTEM': _system, 'TS': 2, 'TGID': bytes_3(9),'ACTIVE': True,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [],'ON': [_tgid,],'RESET': [], 'TIMER': time() + (_tmout * 60)})
|
||||||
else:
|
else:
|
||||||
@ -444,6 +442,7 @@ def mysql_config_check():
|
|||||||
listeningPorts[system] = reactor.listenUDP(CONFIG['SYSTEMS'][system]['PORT'], systems[system], interface=CONFIG['SYSTEMS'][system]['IP'])
|
listeningPorts[system] = reactor.listenUDP(CONFIG['SYSTEMS'][system]['PORT'], systems[system], interface=CONFIG['SYSTEMS'][system]['IP'])
|
||||||
else:
|
else:
|
||||||
logger.debug('(MYSQL) new disabled system %s',system)
|
logger.debug('(MYSQL) new disabled system %s',system)
|
||||||
|
_tmout = SQLCONFIG[system]['DEFAULT_UA_TIMER']
|
||||||
#Do ACL processing
|
#Do ACL processing
|
||||||
# Subscriber and TGID ACLs
|
# Subscriber and TGID ACLs
|
||||||
logger.debug('(MYSQL) building ACLs')
|
logger.debug('(MYSQL) building ACLs')
|
||||||
@ -462,65 +461,89 @@ def mysql_config_check():
|
|||||||
if e['SYSTEM'] == system and e['TS'] == 2:
|
if e['SYSTEM'] == system and e['TS'] == 2:
|
||||||
ts2 = True
|
ts2 = True
|
||||||
if _bridge[0:1] != '#':
|
if _bridge[0:1] != '#':
|
||||||
_tmout = SQLCONFIG[system]['DEFAULT_UA_TIMER']
|
|
||||||
if ts1 == False:
|
if ts1 == False:
|
||||||
BRIDGES[_bridge].append({'SYSTEM': system, 'TS': 1, 'TGID': bytes_3(int(_bridge)),'ACTIVE': False,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [],'ON': [bytes_3(int(_bridge)),],'RESET': [], 'TIMER': time()})
|
BRIDGES[_bridge].append({'SYSTEM': system, 'TS': 1, 'TGID': bytes_3(int(_bridge)),'ACTIVE': False,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [],'ON': [bytes_3(int(_bridge)),],'RESET': [], 'TIMER': time()})
|
||||||
if ts2 == False:
|
if ts2 == False:
|
||||||
BRIDGES[_bridge].append({'SYSTEM': system, 'TS': 2, 'TGID': bytes_3(int(_bridge)),'ACTIVE': False,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [],'ON': [bytes_3(int(_bridge)),],'RESET': [], 'TIMER': time()})
|
BRIDGES[_bridge].append({'SYSTEM': system, 'TS': 2, 'TGID': bytes_3(int(_bridge)),'ACTIVE': False,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [],'ON': [bytes_3(int(_bridge)),],'RESET': [], 'TIMER': time()})
|
||||||
else:
|
else:
|
||||||
_tmout = SQLCONFIG[system]['DEFAULT_UA_TIMER']
|
|
||||||
if ts2 == False:
|
if ts2 == False:
|
||||||
BRIDGES[_bridge].append({'SYSTEM': system, 'TS': 2, 'TGID': bytes_3(9),'ACTIVE': False,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [bytes_3(4000)],'ON': [],'RESET': [], 'TIMER': time()})
|
BRIDGES[_bridge].append({'SYSTEM': system, 'TS': 2, 'TGID': bytes_3(9),'ACTIVE': False,'TIMEOUT': _tmout * 60,'TO_TYPE': 'ON','OFF': [bytes_3(4000)],'ON': [],'RESET': [], 'TIMER': time()})
|
||||||
|
|
||||||
elif SQLCONFIG[system]['ENABLED'] == False and CONFIG['SYSTEMS'][system]['ENABLED'] == True:
|
if SQLCONFIG[system]['DEFAULT_REFLECTOR'] > 0:
|
||||||
|
logger.debug('(MYSQL) %s setting default reflector',system)
|
||||||
|
make_default_reflector(SQLCONFIG[system]['DEFAULT_REFLECTOR'],_tmout,system)
|
||||||
|
|
||||||
|
if SQLCONFIG[system]['TS1_STATIC']:
|
||||||
|
logger.debug('(MYSQL) %s setting static TGs on TS1',system)
|
||||||
|
ts1 = SQLCONFIG[system]['TS1_STATIC'].split(',')
|
||||||
|
for tg in ts1:
|
||||||
|
if not tg:
|
||||||
|
continue
|
||||||
|
tg = int(tg)
|
||||||
|
make_static_tg(tg,1,_tmout,system)
|
||||||
|
|
||||||
|
if SQLCONFIG[system]['TS2_STATIC']:
|
||||||
|
logger.debug('(MYSQL) %s setting static TGs on TS2',system)
|
||||||
|
ts2 = SQLCONFIG[system]['TS2_STATIC'].split(',')
|
||||||
|
for tg in ts2:
|
||||||
|
if not tg:
|
||||||
|
continue
|
||||||
|
tg = int(tg)
|
||||||
|
make_static_tg(tg,2,_tmout,system)
|
||||||
|
|
||||||
|
continue
|
||||||
|
|
||||||
|
if SQLCONFIG[system]['ENABLED'] == False and CONFIG['SYSTEMS'][system]['ENABLED'] == True:
|
||||||
logger.debug('(MYSQL) %s changed from enabled to disabled, killing HBP listener',system)
|
logger.debug('(MYSQL) %s changed from enabled to disabled, killing HBP listener',system)
|
||||||
systems[system].master_dereg()
|
systems[system].master_dereg()
|
||||||
systems[system]._system_maintenance.stop()
|
systems[system]._system_maintenance.stop()
|
||||||
listeningPorts[system].stopListening()
|
listeningPorts[system].stopListening()
|
||||||
|
|
||||||
elif CONFIG['SYSTEMS'][system]['ENABLED'] == False and SQLCONFIG[system]['ENABLED'] == True:
|
if CONFIG['SYSTEMS'][system]['ENABLED'] == False and SQLCONFIG[system]['ENABLED'] == True:
|
||||||
logger.debug('(MYSQL) %s changed from disabled to enabled, starting HBP listener',system)
|
logger.debug('(MYSQL) %s changed from disabled to enabled, starting HBP listener',system)
|
||||||
systems[system] = routerHBP(system, CONFIG, report_server)
|
systems[system] = routerHBP(system, CONFIG, report_server)
|
||||||
listeningPorts[system] = reactor.listenUDP(CONFIG['SYSTEMS'][system]['PORT'], systems[system], interface=CONFIG['SYSTEMS'][system]['IP'])
|
listeningPorts[system] = reactor.listenUDP(CONFIG['SYSTEMS'][system]['PORT'], systems[system], interface=CONFIG['SYSTEMS'][system]['IP'])
|
||||||
logger.debug('(GLOBAL) %s instance created: %s, %s', CONFIG['SYSTEMS'][system]['MODE'], system, systems[system])
|
logger.debug('(GLOBAL) %s instance created: %s, %s', CONFIG['SYSTEMS'][system]['MODE'], system, systems[system])
|
||||||
|
|
||||||
elif SQLCONFIG[system]['IP'] != CONFIG['SYSTEMS'][system]['IP'] and CONFIG['SYSTEMS'][system]['ENABLED'] == True:
|
if SQLCONFIG[system]['IP'] != CONFIG['SYSTEMS'][system]['IP'] and CONFIG['SYSTEMS'][system]['ENABLED'] == True:
|
||||||
logger.debug('(MYSQL) %s IP binding changed on enabled system, killing HBP listener. Will restart in 1 minute',system)
|
logger.debug('(MYSQL) %s IP binding changed on enabled system, killing HBP listener. Will restart in 1 minute',system)
|
||||||
systems[system].master_dereg()
|
systems[system].master_dereg()
|
||||||
systems[system]._system_maintenance.stop()
|
systems[system]._system_maintenance.stop()
|
||||||
listeningPorts[system].stopListening()
|
listeningPorts[system].stopListening()
|
||||||
SQLCONFIG[system]['ENABLED'] = False
|
SQLCONFIG[system]['ENABLED'] = False
|
||||||
|
|
||||||
elif SQLCONFIG[system]['PORT'] != CONFIG['SYSTEMS'][system]['PORT'] and CONFIG['SYSTEMS'][system]['ENABLED'] == True:
|
if SQLCONFIG[system]['PORT'] != CONFIG['SYSTEMS'][system]['PORT'] and CONFIG['SYSTEMS'][system]['ENABLED'] == True:
|
||||||
logger.debug('(MYSQL) %s Port binding changed on enabled system, killing HBP listener. Will restart in 1 minute',system)
|
logger.debug('(MYSQL) %s Port binding changed on enabled system, killing HBP listener. Will restart in 1 minute',system)
|
||||||
systems[system].master_dereg()
|
systems[system].master_dereg()
|
||||||
systems[system]._system_maintenance.stop()
|
systems[system]._system_maintenance.stop()
|
||||||
listeningPorts[system].stopListening()
|
listeningPorts[system].stopListening()
|
||||||
SQLCONFIG[system]['ENABLED'] = False
|
SQLCONFIG[system]['ENABLED'] = False
|
||||||
|
|
||||||
elif SQLCONFIG[system]['PASSPHRASE'] != CONFIG['SYSTEMS'][system]['PASSPHRASE'] and CONFIG['SYSTEMS'][system]['ENABLED'] == True:
|
if SQLCONFIG[system]['PASSPHRASE'] != CONFIG['SYSTEMS'][system]['PASSPHRASE'] and CONFIG['SYSTEMS'][system]['ENABLED'] == True:
|
||||||
logger.debug('(MYSQL) %s Passphrase changed on enabled system. Kicking peers',system)
|
logger.debug('(MYSQL) %s Passphrase changed on enabled system. Kicking peers',system)
|
||||||
systems[system].master_dereg()
|
systems[system].master_dereg()
|
||||||
|
|
||||||
elif SQLCONFIG[system]['DEFAULT_REFLECTOR'] != CONFIG['SYSTEMS'][system]['DEFAULT_REFLECTOR'] and CONFIG['SYSTEMS'][system]['ENABLED'] == True:
|
if SQLCONFIG[system]['DEFAULT_REFLECTOR'] != CONFIG['SYSTEMS'][system]['DEFAULT_REFLECTOR']:
|
||||||
|
_tmout = SQLCONFIG[system]['DEFAULT_UA_TIMER']
|
||||||
if SQLCONFIG[system]['DEFAULT_REFLECTOR'] > 0:
|
if SQLCONFIG[system]['DEFAULT_REFLECTOR'] > 0:
|
||||||
logger.debug('(MYSQL) %s default reflector changed, updating',system)
|
logger.debug('(MYSQL) %s default reflector changed, updating',system)
|
||||||
reset_default_reflector(CONFIG['SYSTEMS'][system]['DEFAULT_REFLECTOR'],system)
|
reset_default_reflector(CONFIG['SYSTEMS'][system]['DEFAULT_REFLECTOR'],_tmout,system)
|
||||||
make_default_reflector(SQLCONFIG[system]['DEFAULT_REFLECTOR'],system)
|
make_default_reflector(SQLCONFIG[system]['DEFAULT_REFLECTOR'],_tmout,system)
|
||||||
else:
|
else:
|
||||||
logger.debug('(MYSQL) %s default reflector disabled, updating',system)
|
logger.debug('(MYSQL) %s default reflector disabled, updating',system)
|
||||||
reset_default_reflector(CONFIG['SYSTEMS'][system]['DEFAULT_REFLECTOR'],system)
|
reset_default_reflector(CONFIG['SYSTEMS'][system]['DEFAULT_REFLECTOR'],system)
|
||||||
|
|
||||||
elif SQLCONFIG[system]['TS1_STATIC'] != CONFIG['SYSTEMS'][system]['TS1_STATIC'] and CONFIG['SYSTEMS'][system]['ENABLED'] == True:
|
if SQLCONFIG[system]['TS1_STATIC'] != CONFIG['SYSTEMS'][system]['TS1_STATIC']:
|
||||||
|
_tmout = SQLCONFIG[system]['DEFAULT_UA_TIMER']
|
||||||
logger.debug('(MYSQL) %s TS1 static TGs changed, updating',system)
|
logger.debug('(MYSQL) %s TS1 static TGs changed, updating',system)
|
||||||
ts1 = []
|
ts1 = []
|
||||||
if CONFIG['SYSTEMS'][system]['TS1_STATIC']:
|
if CONFIG['SYSTEMS'][system]['TS1_STATIC']:
|
||||||
ts1 = CONFIG['SYSTEMS'][system]['TS1_STATIC'].split(',')
|
ts1 = CONFIG['SYSTEMS'][system]['TS1_STATIC'].split(',')
|
||||||
for tg in ts1:
|
for tg in ts1:
|
||||||
if not tg:
|
if not tg:
|
||||||
continue
|
continue
|
||||||
tg = int(tg)
|
tg = int(tg)
|
||||||
reset_static_tg(tg,1,system)
|
reset_static_tg(tg,1,_tmout,system)
|
||||||
ts1 = []
|
ts1 = []
|
||||||
if SQLCONFIG[system]['TS1_STATIC']:
|
if SQLCONFIG[system]['TS1_STATIC']:
|
||||||
ts1 = SQLCONFIG[system]['TS1_STATIC'].split(',')
|
ts1 = SQLCONFIG[system]['TS1_STATIC'].split(',')
|
||||||
@ -528,18 +551,19 @@ def mysql_config_check():
|
|||||||
if not tg:
|
if not tg:
|
||||||
continue
|
continue
|
||||||
tg = int(tg)
|
tg = int(tg)
|
||||||
make_static_tg(tg,1,system)
|
make_static_tg(tg,1,_tmout,system)
|
||||||
|
|
||||||
elif SQLCONFIG[system]['TS2_STATIC'] != CONFIG['SYSTEMS'][system]['TS2_STATIC'] and CONFIG['SYSTEMS'][system]['ENABLED'] == True:
|
if SQLCONFIG[system]['TS2_STATIC'] != CONFIG['SYSTEMS'][system]['TS2_STATIC']:
|
||||||
|
_tmout = SQLCONFIG[system]['DEFAULT_UA_TIMER']
|
||||||
logger.debug('(MYSQL) %s TS2 static TGs changed, updating',system)
|
logger.debug('(MYSQL) %s TS2 static TGs changed, updating',system)
|
||||||
ts2 = []
|
ts2 = []
|
||||||
if CONFIG['SYSTEMS'][system]['TS2_STATIC']:
|
if CONFIG['SYSTEMS'][system]['TS2_STATIC']:
|
||||||
ts2 = CONFIG['SYSTEMS'][system]['TS2_STATIC'].split(',')
|
ts2 = CONFIG['SYSTEMS'][system]['TS2_STATIC'].split(',')
|
||||||
for tg in ts2:
|
for tg in ts2:
|
||||||
if not tg:
|
if not tg:
|
||||||
continue
|
continue
|
||||||
tg = int(tg)
|
tg = int(tg)
|
||||||
reset_static_tg(tg,2,system)
|
reset_static_tg(tg,2,_tmout,system)
|
||||||
ts2 = []
|
ts2 = []
|
||||||
if SQLCONFIG[system]['TS2_STATIC']:
|
if SQLCONFIG[system]['TS2_STATIC']:
|
||||||
ts2 = SQLCONFIG[system]['TS2_STATIC'].split(',')
|
ts2 = SQLCONFIG[system]['TS2_STATIC'].split(',')
|
||||||
@ -547,7 +571,7 @@ def mysql_config_check():
|
|||||||
if not tg:
|
if not tg:
|
||||||
continue
|
continue
|
||||||
tg = int(tg)
|
tg = int(tg)
|
||||||
make_static_tg(tg,2,system)
|
make_static_tg(tg,2,_tmout,system)
|
||||||
|
|
||||||
#Add MySQL config data to config dict
|
#Add MySQL config data to config dict
|
||||||
CONFIG['SYSTEMS'].update(SQLCONFIG)
|
CONFIG['SYSTEMS'].update(SQLCONFIG)
|
||||||
@ -831,7 +855,7 @@ class routerHBP(HBSYSTEM):
|
|||||||
_bridgename = '#'+ str(_int_dst_id)
|
_bridgename = '#'+ str(_int_dst_id)
|
||||||
if _bridgename not in BRIDGES and not (_int_dst_id >= 4000 and _int_dst_id <= 5000):
|
if _bridgename not in BRIDGES and not (_int_dst_id >= 4000 and _int_dst_id <= 5000):
|
||||||
logger.info('(%s) [A] Reflector for TG %s does not exist. Creating as User Activated',self._system, _int_dst_id)
|
logger.info('(%s) [A] Reflector for TG %s does not exist. Creating as User Activated',self._system, _int_dst_id)
|
||||||
make_single_reflector(_dst_id,self._system)
|
make_single_reflector(_dst_id,CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER'],self._system)
|
||||||
|
|
||||||
if _int_dst_id > 10 and _int_dst_id != 5000:
|
if _int_dst_id > 10 and _int_dst_id != 5000:
|
||||||
for _bridge in BRIDGES:
|
for _bridge in BRIDGES:
|
||||||
@ -983,7 +1007,7 @@ class routerHBP(HBSYSTEM):
|
|||||||
#Create default bridge for unknown TG
|
#Create default bridge for unknown TG
|
||||||
if int_id(_dst_id) > 10 and (int_id(_dst_id)) not in BRIDGES:
|
if int_id(_dst_id) > 10 and (int_id(_dst_id)) not in BRIDGES:
|
||||||
logger.info('(%s) Bridge for TG %s does not exist. Creating as User Activated',self._system, int_id(_dst_id))
|
logger.info('(%s) Bridge for TG %s does not exist. Creating as User Activated',self._system, int_id(_dst_id))
|
||||||
make_single_bridge(_dst_id,self._system,_slot)
|
make_single_bridge(_dst_id,self._system,_slot,CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER'])
|
||||||
|
|
||||||
for _bridge in BRIDGES:
|
for _bridge in BRIDGES:
|
||||||
for _system in BRIDGES[_bridge]:
|
for _system in BRIDGES[_bridge]:
|
||||||
@ -1348,13 +1372,14 @@ if __name__ == '__main__':
|
|||||||
if CONFIG['SYSTEMS'][system]['MODE'] != 'MASTER':
|
if CONFIG['SYSTEMS'][system]['MODE'] != 'MASTER':
|
||||||
continue
|
continue
|
||||||
if CONFIG['SYSTEMS'][system]['DEFAULT_REFLECTOR'] > 0:
|
if CONFIG['SYSTEMS'][system]['DEFAULT_REFLECTOR'] > 0:
|
||||||
make_default_reflector(CONFIG['SYSTEMS'][system]['DEFAULT_REFLECTOR'],system)
|
make_default_reflector(CONFIG['SYSTEMS'][system]['DEFAULT_REFLECTOR'],CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER'],system)
|
||||||
|
|
||||||
#static TGs
|
#static TGs
|
||||||
logger.debug('(ROUTER) setting static TGs')
|
logger.debug('(ROUTER) setting static TGs')
|
||||||
for system in CONFIG['SYSTEMS']:
|
for system in CONFIG['SYSTEMS']:
|
||||||
if CONFIG['SYSTEMS'][system]['MODE'] != 'MASTER':
|
if CONFIG['SYSTEMS'][system]['MODE'] != 'MASTER':
|
||||||
continue
|
continue
|
||||||
|
_tmout = CONFIG['SYSTEMS'][system]['DEFAULT_UA_TIMER']
|
||||||
ts1 = []
|
ts1 = []
|
||||||
ts2 = []
|
ts2 = []
|
||||||
if CONFIG['SYSTEMS'][system]['TS1_STATIC']:
|
if CONFIG['SYSTEMS'][system]['TS1_STATIC']:
|
||||||
@ -1372,12 +1397,12 @@ if __name__ == '__main__':
|
|||||||
if not tg:
|
if not tg:
|
||||||
continue
|
continue
|
||||||
tg = int(tg)
|
tg = int(tg)
|
||||||
make_static_tg(tg,1,system)
|
make_static_tg(tg,1,_tmout,system)
|
||||||
for tg in ts2:
|
for tg in ts2:
|
||||||
if not tg:
|
if not tg:
|
||||||
continue
|
continue
|
||||||
tg = int(tg)
|
tg = int(tg)
|
||||||
make_static_tg(tg,2,system)
|
make_static_tg(tg,2,_tmout,system)
|
||||||
|
|
||||||
# INITIALIZE THE REPORTING LOOP
|
# INITIALIZE THE REPORTING LOOP
|
||||||
if CONFIG['REPORTS']['REPORT']:
|
if CONFIG['REPORTS']['REPORT']:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user