Take the first element of an list
And fix encoding issue
This commit is contained in:
parent
4ed99f75bb
commit
35b1df511a
1 changed files with 3 additions and 1 deletions
|
|
@ -155,6 +155,8 @@ class GenericMuninPlugin(object):
|
||||||
attribs = self.attribvalue.split('/')
|
attribs = self.attribvalue.split('/')
|
||||||
for attrib in attribs:
|
for attrib in attribs:
|
||||||
result = getattr(result, attrib)
|
result = getattr(result, attrib)
|
||||||
|
if type(result) is list:
|
||||||
|
result = result[0]
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def monitored(self, result):
|
def monitored(self, result):
|
||||||
|
|
@ -201,7 +203,7 @@ class GenericMuninPlugin(object):
|
||||||
if first:
|
if first:
|
||||||
type = 'AREA'
|
type = 'AREA'
|
||||||
first = False
|
first = False
|
||||||
self.write_output('%s.label %s' % (id, getattr(result, self.attriblabel).encode('iso-8859-15')))
|
self.write_output('%s.label %s' % (id.encode('iso-8859-15'), getattr(result, self.attriblabel).encode('iso-8859-15')))
|
||||||
if self.cumulate:
|
if self.cumulate:
|
||||||
self.write_output('%s.draw %s' % (id, type))
|
self.write_output('%s.draw %s' % (id, type))
|
||||||
except CallErrors, errors:
|
except CallErrors, errors:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue