Skip to content
Permalink
Browse files

Plugin arris-tg3442: fix code style issues reported by flake8

  • Loading branch information...
sumpfralle committed Aug 13, 2019
1 parent 69602b1 commit c586f34d4b76693d3a1b7f33c18309c3c1e242b9
Showing with 11 additions and 14 deletions.
  1. +11 −14 plugins/router/arris-tg3442
@@ -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:

0 comments on commit c586f34

Please sign in to comment.
You can’t perform that action at this time.