Skip to content
Snippets Groups Projects
Commit 84e110aa authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

gnt-network: Fix import for textwrap


The style guide says to use “import foo”-style imports, not “from foo
import bar” unless it's a Ganeti module. There are some places with
exceptions, but this one certainly isn't warranted. Also fix the import
order.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent b34864e8
No related branches found
No related tags found
No related merge requests found
......@@ -24,12 +24,13 @@
# W0401: Wildcard import ganeti.cli
# W0614: Unused import %s from wildcard import (since we need cli)
import textwrap
from ganeti.cli import *
from ganeti import constants
from ganeti import opcodes
from ganeti import utils
from ganeti import errors
from textwrap import wrap
#: default list of fields for L{ListNetworks}
......@@ -215,14 +216,14 @@ def ShowNetworkConfig(_, args):
100 * float(free_count) / float(size))
ToStdout(" Usage map:")
idx = 0
for line in wrap(mapping, width=64):
for line in textwrap.wrap(mapping, width=64):
ToStdout(" %s %s %d", str(idx).rjust(3), line.ljust(64), idx + 63)
idx += 64
ToStdout(" (X) used (.) free")
if ext_res:
ToStdout(" externally reserved IPs:")
for line in wrap(ext_res, width=64):
for line in textwrap.wrap(ext_res, width=64):
ToStdout(" %s" % line)
if group_list:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment