def register_update(eapi):
"""Ensures the inbound URL for the BTS is up to date."""
vpn_ip = system_utilities.get_vpn_ip()
vpn_status = 'up' if vpn_ip else 'down'
# This could fail when offline! Must handle connection exceptions.
params = {
'bts_uuid': _get_snowflake(),
'vpn_status': vpn_status,
'vpn_ip': vpn_ip,
'federer_port': '80',
}
try:
d = _send_cloud_req(
requests.get,
'/bts/register',
'BTS registration',
params=params,
headers=eapi.auth_header,
timeout=11)
if 'bts_secret' in d:
conf['bts_secret'] = d['bts_secret']
except RegistrationError as ex:
logger.error(str(ex))
registration.py 文件源码
python
阅读 31
收藏 0
点赞 0
评论 0
评论列表
文章目录