[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[virt-tools-list] [virt-manager][PATCH] Remove unnecessary nested try block.



From: Leonardo Garcia <lagarcia br ibm com>

This nested block has been added by python-virtinst's commit
4a9664634dd5ae65ed92b59b1f1543633c7d8112, aparently without need.
---
 virtinst/Storage.py |   45 ++++++++++++++++++++++-----------------------
 1 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/virtinst/Storage.py b/virtinst/Storage.py
index b29532a..1dc1768 100644
--- a/virtinst/Storage.py
+++ b/virtinst/Storage.py
@@ -1228,29 +1228,28 @@ class StorageVolume(StorageObject):
             meter = urlgrabber.progress.BaseMeter()
 
         try:
-            try:
-                self._install_finished = False
-                t.start()
-                meter.start(size=self.capacity,
-                            text=_("Allocating '%s'") % self.name)
-
-                if self.input_vol:
-                    vol = self.pool.createXMLFrom(xml, self.input_vol, 0)
-                else:
-                    vol = self.pool.createXML(xml, 0)
-
-                meter.end(self.capacity)
-                logging.debug("Storage volume '%s' install complete.",
-                              self.name)
-                return vol
-            except libvirt.libvirtError, e:
-                if support.is_error_nosupport(e):
-                    raise RuntimeError("Libvirt version does not support "
-                                       "storage cloning.")
-                raise
-            except Exception, e:
-                raise RuntimeError("Couldn't create storage volume "
-                                   "'%s': '%s'" % (self.name, str(e)))
+            self._install_finished = False
+            t.start()
+            meter.start(size=self.capacity,
+                        text=_("Allocating '%s'") % self.name)
+
+            if self.input_vol:
+                vol = self.pool.createXMLFrom(xml, self.input_vol, 0)
+            else:
+                vol = self.pool.createXML(xml, 0)
+
+            meter.end(self.capacity)
+            logging.debug("Storage volume '%s' install complete.",
+                          self.name)
+            return vol
+        except libvirt.libvirtError, e:
+            if support.is_error_nosupport(e):
+                raise RuntimeError("Libvirt version does not support "
+                                   "storage cloning.")
+            raise
+        except Exception, e:
+            raise RuntimeError("Couldn't create storage volume "
+                               "'%s': '%s'" % (self.name, str(e)))
         finally:
             self._install_finished = True
 
-- 
1.7.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]