Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
fixed config.py
Browse files Browse the repository at this point in the history
node_exporter hasn't been replaced...
  • Loading branch information
felbinger authored Apr 30, 2023
1 parent d7da007 commit f0fdef5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions deb/opt/vyatta-frr_exporter/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def generate(frr_exporter):

# merge web/listen-address with subelement web/listen-address/port
# {'web': {'listen-address': {'0.0.0.0': {'port': '8080'}}}
if 'web' in node_exporter and 'listen-address' in node_exporter['web']:
address = list(node_exporter['web']['listen-address'].keys())[0]
port = node_exporter['web']['listen-address'][address].get("port", 9342)
node_exporter['web']['listen-address'] = f"{address}:{port}"
if 'web' in frr_exporter and 'listen-address' in frr_exporter['web']:
address = list(frr_exporter['web']['listen-address'].keys())[0]
port = frr_exporter['web']['listen-address'][address].get("port", 9342)
frr_exporter['web']['listen-address'] = f"{address}:{port}"

with open('/opt/vyatta-frr_exporter/config.j2', 'r') as tmpl, open(config_file, 'w') as out:
template = Template(tmpl.read()).render(data=frr_exporter)
Expand Down

0 comments on commit f0fdef5

Please sign in to comment.