mirror of
https://github.com/nikdoof/aaisp2mqtt.git
synced 2025-12-25 08:39:21 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
4d624b1faf
|
|||
|
da3727c672
|
@@ -12,7 +12,7 @@ import requests
|
||||
import argparse
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
VERSION = 0.2
|
||||
VERSION = '0.2.2'
|
||||
|
||||
AAISP_INFO_URL = 'https://chaos2.aa.net.uk/broadband/info'
|
||||
|
||||
@@ -55,7 +55,7 @@ def main():
|
||||
sys.exit(1)
|
||||
|
||||
# attempt to get details from aaisp
|
||||
LOG.info('Connecting to AAISP CHAOSv2 endpoint')
|
||||
LOG.info('Connecting to AAISP CHAOSv2 endpoint as %s/%s', aaisp_username, '*' * len(aaisp_password))
|
||||
response = requests.get(AAISP_INFO_URL, params={
|
||||
'control_login': aaisp_username,
|
||||
'control_password': aaisp_password
|
||||
@@ -66,7 +66,10 @@ def main():
|
||||
data = response.json()
|
||||
|
||||
if 'info' not in data:
|
||||
LOG.fatal('info section not found in AAISP CHAOSv2 response')
|
||||
if 'error' in data:
|
||||
LOG.fatal('Error encounted: %s' % data['error'])
|
||||
else:
|
||||
LOG.fatal('info section not found in AAISP CHAOSv2 response')
|
||||
sys.exit(1)
|
||||
circuits = data['info']
|
||||
LOG.info('Got %s circuits', len(circuits))
|
||||
|
||||
Reference in New Issue
Block a user