[Kimchi-devel] [PATCH 1/3] make pyflakes happly

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Thu Mar 13 03:13:53 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

make pyflakes happly before introduce pyflakes.

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 src/kimchi/control/plugins.py    | 2 +-
 src/kimchi/featuretests.py       | 2 --
 src/kimchi/mockmodel.py          | 6 +++---
 src/kimchi/model/storagepools.py | 2 +-
 src/kimchi/screenshot.py         | 1 -
 src/kimchi/template.py           | 1 -
 tests/test_server.py             | 1 -
 ui/pages/help/gen-index.py       | 1 -
 8 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/kimchi/control/plugins.py b/src/kimchi/control/plugins.py
index 8dc2273..12c621e 100644
--- a/src/kimchi/control/plugins.py
+++ b/src/kimchi/control/plugins.py
@@ -18,7 +18,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import kimchi.template
-from kimchi.control.base import Collection, Resource
+from kimchi.control.base import Collection
 from kimchi.control.utils import get_class_name, model_fn
 from kimchi.control.utils import UrlSubNode
 
diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py
index 045f72b..a8d8867 100644
--- a/src/kimchi/featuretests.py
+++ b/src/kimchi/featuretests.py
@@ -20,7 +20,6 @@
 import cherrypy
 import libvirt
 import lxml.etree as ET
-import os
 import subprocess
 import threading
 
@@ -28,7 +27,6 @@ import threading
 from lxml.builder import E
 
 
-from kimchi import config
 from kimchi.utils import kimchi_log
 
 
diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index b842b6c..7c2e2f3 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -51,7 +51,7 @@ from kimchi.model.utils import get_vm_name
 from kimchi.model.vms import VM_STATIC_UPDATE_PARAMS
 from kimchi.objectstore import ObjectStore
 from kimchi.screenshot import VMScreenshot
-from kimchi.utils import pool_name_from_uri, run_command
+from kimchi.utils import pool_name_from_uri
 from kimchi.utils import template_name_from_uri
 from kimchi.vmtemplate import VMTemplate
 
@@ -125,7 +125,7 @@ class MockModel(object):
 
     def vm_start(self, name):
         self._get_vm(name).info['state'] = 'running'
-        info = self._get_vm(name).info
+        self._get_vm(name).info
 
     def vm_stop(self, name):
         self._get_vm(name).info['state'] = 'shutoff'
@@ -703,7 +703,7 @@ class MockModel(object):
     def add_task(self, target_uri, fn, opaque=None):
         id = self.next_taskid
         self.next_taskid = self.next_taskid + 1
-        task = AsyncTask(id, target_uri, fn, self.objstore, opaque)
+        AsyncTask(id, target_uri, fn, self.objstore, opaque)
 
         return id
 
diff --git a/src/kimchi/model/storagepools.py b/src/kimchi/model/storagepools.py
index fea19f6..92b2496 100644
--- a/src/kimchi/model/storagepools.py
+++ b/src/kimchi/model/storagepools.py
@@ -222,7 +222,7 @@ class StoragePoolModel(object):
         try:
             poolDef.prepare(conn)
             return True
-        except Exception as e:
+        except Exception:
             return False
 
     def lookup(self, name):
diff --git a/src/kimchi/screenshot.py b/src/kimchi/screenshot.py
index 6c8a599..0040d7c 100644
--- a/src/kimchi/screenshot.py
+++ b/src/kimchi/screenshot.py
@@ -20,7 +20,6 @@
 
 import glob
 import os
-import random
 import signal
 import tempfile
 import time
diff --git a/src/kimchi/template.py b/src/kimchi/template.py
index 5707121..9bb2da5 100644
--- a/src/kimchi/template.py
+++ b/src/kimchi/template.py
@@ -20,7 +20,6 @@
 import cherrypy
 import errno
 import json
-import os
 
 
 from kimchi.config import paths
diff --git a/tests/test_server.py b/tests/test_server.py
index d7b93ad..d06e17a 100644
--- a/tests/test_server.py
+++ b/tests/test_server.py
@@ -17,7 +17,6 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
-import json
 import os
 import unittest
 
diff --git a/ui/pages/help/gen-index.py b/ui/pages/help/gen-index.py
index 56cbf47..cf7c5d7 100755
--- a/ui/pages/help/gen-index.py
+++ b/ui/pages/help/gen-index.py
@@ -18,7 +18,6 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
-import glob
 import libxml2
 import sys
 
-- 
1.8.4.2




More information about the Kimchi-devel mailing list