Skip to content

Commit

Permalink
Replace dots with underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
tomislacker committed Apr 11, 2019
1 parent bb003f0 commit 3e88003
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arrisparser/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
app = Flask(__name__)


def clean_address(address):
return address.replace('.', '_')


@app.route('/<prefix>/<address>')
def prometheus(prefix, address):
url = f'http://{address}/cgi-bin/status'
Expand All @@ -18,6 +22,9 @@ def prometheus(prefix, address):
data = from_html_string(doc_contents)
response = []

# Clean up the address so Prometheus can parse it
address = clean_address(address)

for ch in data['DownstreamBondedChannels']:
for numeric in [
'ChannelID',
Expand Down

0 comments on commit 3e88003

Please sign in to comment.