From 84e110aa6d0f605b881b167f200d73d41a39d4f6 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Tue, 18 Dec 2012 18:21:33 +0100
Subject: [PATCH] gnt-network: Fix import for textwrap
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/client/gnt_network.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/client/gnt_network.py b/lib/client/gnt_network.py
index 91c1a1a54..714658214 100644
--- a/lib/client/gnt_network.py
+++ b/lib/client/gnt_network.py
@@ -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:
-- 
GitLab