7 ms·
What bullshit. I can't touch type but my code reads: def snmp_command(session, oid, media_servers): result = list() for host_name in media_servers:
by vithlani 12y ago
What bullshit.
I can't touch type but my code reads:
def snmp_command(session, oid, media_servers):
result = list()
for host_name in media_servers:
snmp = SNMP_CMD.format(host=host_name, oid=oid)
snmp_reply = [x for x in session.cmditer(snmp)]
if len(snmp_reply) == 0:
log.warning("No data for EMS Media Server SNMP cmd {0} for host {1}".format(snmp, host_name))
continue
# add the Media Server host from which we got this reply to the list of snmp reply
snmp_reply.append(host_name)
result.append(snmp_reply)
return result
- Derbasti 12y agoAs I said, not you, particularly. But bad typists exist, and they tend to want to type less, which leads to code that is worse than it could be. That said, where's your docstring? Why are your lines longer than 80 chars? Why is your indent 2 chars instead of 4? What does `oid` mean? http://legacy.python.org/dev/peps/pep-0008/ http://legacy.python.org/dev/peps/pep-0008/