From da9980b7a6be9d44453f0c41ed05d08cd74bbc09 Mon Sep 17 00:00:00 2001 From: Palollo Date: Mon, 1 Jul 2024 13:12:25 +0200 Subject: [PATCH] Fix error when infrastructure without IP In case of error attaching a floating IP, the infrastructure has None as the value for IP, and an exception is raised in dump_table() --- ec3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ec3 b/ec3 index eba7415..dfc69b7 100755 --- a/ec3 +++ b/ec3 @@ -115,7 +115,7 @@ def dump_table(l, order, align={}): widths = dict([ (f, max([ len(str(d[f])) for d in l ] + [len(f)])+2) for f in order ]) o = [ "".join([ "{0: ^{width}}".format(f, width=widths[f]) for f in order ]) ] o.append("-"*sum(widths.values())) - o.extend([ "".join([ "{0: {a}{width}}".format(d[f], a=align.get(f, "^"), width=widths[f]) for f in order ]) + o.extend([ "".join([ "{0: {a}{width}}".format(str(d[f]), a=align.get(f, "^"), width=widths[f]) for f in order ]) for d in l ]) return "\n".join(o)