@@ -366,16 +366,16 @@ def converter(value):
366
366
"""Tries to convert input value to an integer.
367
367
368
368
If input can be safely converted to number it returns an ``int`` type.
369
- If input is a valid string( not empty) it returns that.
370
- In all other cases we return None, including the ones which raise
371
- exceptions when conversion fails .
369
+ If input is a valid string but not an empty one it returns that.
370
+ In all other cases we return None, including the ones which an
371
+ ``TypeError`` exception is raised by ``int()`` .
372
372
For floating point numbers, it truncates towards zero.
373
373
374
374
Why are we doing this?
375
375
HAProxy may return for a metric either a number or zero or string or an
376
376
empty string.
377
377
378
- It is up to the caller to use correctly the returned value. If the returned
378
+ It is up to the caller to correctly use the returned value. If the returned
379
379
value is passed to a function which does math operations the caller has to
380
380
filtered out possible ``None`` values.
381
381
@@ -408,7 +408,7 @@ def converter(value):
408
408
return value .strip () or None
409
409
except TypeError :
410
410
# This is to catch the case where input value is a data structure or
411
- # object it is very unlikely someone to pass those, but you never know.
411
+ # object. It is very unlikely someone to pass those, but you never know.
412
412
return None
413
413
414
414
@@ -455,7 +455,7 @@ def __getattr__(self, attr):
455
455
456
456
457
457
def info2dict (raw_info ):
458
- """Build a dictionary structure.
458
+ """Build a dictionary structure from the output of 'show info' command .
459
459
460
460
:param raw_info: data returned by 'show info' UNIX socket command
461
461
:type raw_info: ``list``
0 commit comments