esx_vi_generator: Simplify alignment function

Generate whitespace using the standard function ljust() that is
available in both Py3 [1] and Py2 [2].

1: https://docs.python.org/3/library/stdtypes.html?highlight=strip#str.ljust
2: https://docs.python.org/2.7/library/string.html#string.ljust

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
This commit is contained in:
Radostin Stoyanov 2018-03-20 06:48:51 +00:00 committed by Daniel P. Berrangé
parent b89111afed
commit f3a99869ff

View File

@ -49,10 +49,7 @@ separator = "/* " + ("* " * 37) + "*\n"
def aligned(left, right, length=59):
while len(left) < length:
left += " "
return left + right
return left.ljust(length, ' ') + right