mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
change Python iteritems by items
This commit is contained in:
parent
168f6f924f
commit
71f9280576
1 changed files with 4 additions and 4 deletions
|
@ -134,11 +134,11 @@ class TorPlugin(object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def conf_from_dict(graph, labels):
|
def conf_from_dict(graph, labels):
|
||||||
# header
|
# header
|
||||||
for key, val in graph.iteritems():
|
for key, val in graph.items():
|
||||||
print('graph_{} {}'.format(key, val))
|
print('graph_{} {}'.format(key, val))
|
||||||
# values
|
# values
|
||||||
for label, attributes in labels.iteritems():
|
for label, attributes in labels.items():
|
||||||
for key, val in attributes.iteritems():
|
for key, val in attributes.items():
|
||||||
print('{}.{} {}'.format(label, key, val))
|
print('{}.{} {}'.format(label, key, val))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -253,7 +253,7 @@ class TorConnections(TorPlugin):
|
||||||
states = dict((state, 0) for state in stem.ORStatus)
|
states = dict((state, 0) for state in stem.ORStatus)
|
||||||
for connection in connections:
|
for connection in connections:
|
||||||
states[connection.rsplit(None, 1)[-1]] += 1
|
states[connection.rsplit(None, 1)[-1]] += 1
|
||||||
for state, count in states.iteritems():
|
for state, count in states.items():
|
||||||
print('{}.value {}'.format(state.lower(), count))
|
print('{}.value {}'.format(state.lower(), count))
|
||||||
except stem.connection.AuthenticationFailure as e:
|
except stem.connection.AuthenticationFailure as e:
|
||||||
print('Authentication failed ({})'.format(e))
|
print('Authentication failed ({})'.format(e))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue