mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51: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,
|
iterations=1000,
|
||||||
dklen=128/8
|
dklen=128/8
|
||||||
)
|
)
|
||||||
secret = { "Password": password, "Nonce": current_session_id }
|
secret = {"Password": password, "Nonce": current_session_id}
|
||||||
plaintext = bytes(json.dumps(secret).encode("ascii"))
|
plaintext = bytes(json.dumps(secret).encode("ascii"))
|
||||||
associated_data = "loginPassword"
|
associated_data = "loginPassword"
|
||||||
# initialize cipher
|
# initialize cipher
|
||||||
|
@ -168,7 +168,7 @@ def docsis_status(session):
|
||||||
downstream_data = json.loads(json_downstream_data)
|
downstream_data = json.loads(json_downstream_data)
|
||||||
upstream_data = json.loads(json_upstream_data)
|
upstream_data = json.loads(json_upstream_data)
|
||||||
# convert lock status to numeric values
|
# convert lock status to numeric values
|
||||||
for d in [ upstream_data, downstream_data ]:
|
for d in [upstream_data, downstream_data]:
|
||||||
for c in d:
|
for c in d:
|
||||||
if c['LockStatus'] == "ACTIVE" or c['LockStatus'] == "Locked":
|
if c['LockStatus'] == "ACTIVE" or c['LockStatus'] == "Locked":
|
||||||
c['LockStatus'] = 1
|
c['LockStatus'] = 1
|
||||||
|
@ -242,24 +242,21 @@ if __name__ == "__main__":
|
||||||
# process all graphs
|
# process all graphs
|
||||||
for g in graph_descriptions:
|
for g in graph_descriptions:
|
||||||
# graph config
|
# graph config
|
||||||
print(
|
print(f"multigraph docsis_{g['name']}")
|
||||||
f"multigraph docsis_{g['name']}\n"
|
print(f"graph_title {g['title']}")
|
||||||
f"graph_title {g['title']}\n" \
|
print(f"graph_category network")
|
||||||
f"graph_category network\n" \
|
print(f"graph_vlabel {g['vlabel']}")
|
||||||
f"graph_vlabel {g['vlabel']}\n" \
|
print(f"graph_info {g['info']}")
|
||||||
f"graph_info {g['info']}\n" \
|
print(f"graph_scale no")
|
||||||
f"graph_scale no\n"
|
|
||||||
)
|
|
||||||
|
|
||||||
# channels
|
# channels
|
||||||
for c in g['data']:
|
for c in g['data']:
|
||||||
# only use channels with PowerLevel
|
# only use channels with PowerLevel
|
||||||
if not c['PowerLevel']:
|
if not c['PowerLevel']:
|
||||||
continue
|
continue
|
||||||
print(
|
info_text = f"Channel type: {c['ChannelType']}, Modulation: {c['Modulation']}"
|
||||||
f"channel_{c['ChannelID']}.label {c['ChannelID']} ({c['Frequency']} MHz)\n"
|
print(f"channel_{c['ChannelID']}.label {c['ChannelID']} ({c['Frequency']} MHz)")
|
||||||
f"channel_{c['ChannelID']}.info Channel type: {c['ChannelType']}, Modulation: {c['Modulation']}"
|
print(f"channel_{c['ChannelID']}.info {info_text}")
|
||||||
)
|
|
||||||
|
|
||||||
# output values ?
|
# output values ?
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue