[Kimchi-devel] [PATCH V2 2/4] make pyflakes happly, remove unused availables

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Mon Mar 17 09:44:57 UTC 2014


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

remove unused availables
make pyflakes happly before introduce pyflakes.

1. the info is unused when start the vm, remove the statement.
2. the AsyncTask, we use it to create a task and run the task.
3. the Exception, we just catch it and do not use it.

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 src/kimchi/mockmodel.py          | 3 +--
 src/kimchi/model/storagepools.py | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index 838af11..ec42ddf 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -127,7 +127,6 @@ class MockModel(object):
 
     def vm_start(self, name):
         self._get_vm(name).info['state'] = 'running'
-        info = self._get_vm(name).info
 
     def vm_stop(self, name):
         self._get_vm(name).info['state'] = 'shutoff'
@@ -729,7 +728,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):
-- 
1.8.5.3




More information about the Kimchi-devel mailing list