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

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

 



From: Leonardo Garcia <lagarcia@xxxxxxxxxx>

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

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux