mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Plugin arris-tg3442: fix code style issues reported by flake8
This commit is contained in:
parent
69602b1bbf
commit
c586f34d4b
1 changed files with 11 additions and 14 deletions
|
@ -105,7 +105,7 @@ def login(session, url, username, password):
|
|||
iterations=1000,
|
||||
dklen=128/8
|
||||
)
|
||||
secret = { "Password": password, "Nonce": current_session_id }
|
||||
secret = {"Password": password, "Nonce": current_session_id}
|
||||
plaintext = bytes(json.dumps(secret).encode("ascii"))
|
||||
associated_data = "loginPassword"
|
||||
# initialize cipher
|
||||
|
@ -168,7 +168,7 @@ def docsis_status(session):
|
|||
downstream_data = json.loads(json_downstream_data)
|
||||
upstream_data = json.loads(json_upstream_data)
|
||||
# convert lock status to numeric values
|
||||
for d in [ upstream_data, downstream_data ]:
|
||||
for d in [upstream_data, downstream_data]:
|
||||
for c in d:
|
||||
if c['LockStatus'] == "ACTIVE" or c['LockStatus'] == "Locked":
|
||||
c['LockStatus'] = 1
|
||||
|
@ -242,24 +242,21 @@ if __name__ == "__main__":
|
|||
# process all graphs
|
||||
for g in graph_descriptions:
|
||||
# graph config
|
||||
print(
|
||||
f"multigraph docsis_{g['name']}\n"
|
||||
f"graph_title {g['title']}\n" \
|
||||
f"graph_category network\n" \
|
||||
f"graph_vlabel {g['vlabel']}\n" \
|
||||
f"graph_info {g['info']}\n" \
|
||||
f"graph_scale no\n"
|
||||
)
|
||||
print(f"multigraph docsis_{g['name']}")
|
||||
print(f"graph_title {g['title']}")
|
||||
print(f"graph_category network")
|
||||
print(f"graph_vlabel {g['vlabel']}")
|
||||
print(f"graph_info {g['info']}")
|
||||
print(f"graph_scale no")
|
||||
|
||||
# channels
|
||||
for c in g['data']:
|
||||
# only use channels with PowerLevel
|
||||
if not c['PowerLevel']:
|
||||
continue
|
||||
print(
|
||||
f"channel_{c['ChannelID']}.label {c['ChannelID']} ({c['Frequency']} MHz)\n"
|
||||
f"channel_{c['ChannelID']}.info Channel type: {c['ChannelType']}, Modulation: {c['Modulation']}"
|
||||
)
|
||||
info_text = f"Channel type: {c['ChannelType']}, Modulation: {c['Modulation']}"
|
||||
print(f"channel_{c['ChannelID']}.label {c['ChannelID']} ({c['Frequency']} MHz)")
|
||||
print(f"channel_{c['ChannelID']}.info {info_text}")
|
||||
|
||||
# output values ?
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue