Bug 467228

Summary: "UnboundLocalError: local variable 'verr' referenced before assign" when "--disk='path=/dev/VGMain/TestTmp'"
Product: [Fedora] Fedora Reporter: Jan Hutař <jhutar>
Component: python-virtinstAssignee: Daniel Berrange <berrange>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: berrange, crobinso, david.bensimon, jlaska, petersen, rdoty, sven
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-10-20 14:20:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Jan Hutař 2008-10-16 14:17:14 UTC
Description of problem:
Traceback when installing on "--disk='path=/dev/VGMain/TestTmp'"

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. # virt-install --name test --ram=300 --os-type=linux --os-variant=rhel5 --accelerate --hvm --cdrom=some-image.iso --disk='path=/dev/VGMain/TestTmp' --vnc --extra-args='ks=http://mysystem.example.com/ks.cfg'

Actual results:
# virt-install --name test --ram=300 --os-type=linux --os-variant=rhel5 --accelerate --hvm --cdrom=some-image.iso --disk='path=/dev/VGMain/TestTmp' --vnc --extra-args='ks=http://mysystem.example.com/ks.cfg'
ERROR    local variable 'verr' referenced before assignment
Traceback (most recent call last):
  File "/usr/sbin/virt-install", line 693, in <module>
  File "/usr/sbin/virt-install", line 571, in main
    options.sparse, options.nodisks, guest, hvm, conn)
  File "/usr/sbin/virt-install", line 240, in get_disks
    is_file_path), disk, size)
  File "/usr/sbin/virt-install", line 240, in <lambda>
    is_file_path), disk, size)
  File "/usr/sbin/virt-install", line 192, in get_disk
  File "/usr/lib/python2.5/site-packages/virtinst/VirtualDisk.py", line 135, in __init__
  File "/usr/lib/python2.5/site-packages/virtinst/VirtualDisk.py", line 369, in __validate_params
  File "/usr/lib/python2.5/site-packages/virtinst/VirtualDisk.py", line 348, in __check_if_path_managed
    "connection: %s" % (self.path, verr))
UnboundLocalError: local variable 'verr' referenced before assign

Expected results:
Installation starts

Additional info:
This "helped" me to workaround the issue:
--- /usr/lib/python2.5/site-packages/virtinst/VirtualDisk.py.orig	2008-10-16 16:15:35.000000000 +0200
+++ /usr/lib/python2.5/site-packages/virtinst/VirtualDisk.py	2008-10-16 16:15:38.000000000 +0200
@@ -344,8 +344,9 @@
                 raise ValueError(_("'%s' is not managed on remote "
                                    "host: %s" % (self.path, verr)))
-                logging.debug("Didn't find path '%s' managed on "
-                              "connection: %s" % (self.path, verr))
+                #logging.debug("Didn't find path '%s' managed on "
+                #              "connection: %s" % (self.path, verr))
+                pass
             self._set_vol_object(vol, validate=False)

Comment 1 Cole Robinson 2008-10-17 19:10:02 UTC
*** Bug 467491 has been marked as a duplicate of this bug. ***

Comment 2 Cole Robinson 2008-10-17 19:10:54 UTC
Fix is already upstream:


I'll pull this in for rawhide.

Comment 3 Cole Robinson 2008-10-17 19:11:51 UTC
FYI, in Comment #1, that isn't the correct syntax for --disk. You want:

--disk path=/foo/bar

Doesn't make the bug any less valid though.

Comment 4 James Laska 2008-10-17 19:27:58 UTC
crobinso: I was just using the virt-manager gui ... should it be using a different format behind the scenes?

Comment 5 Cole Robinson 2008-10-17 20:31:47 UTC
jlaska: we are using the virtinst API directly in virt-manager, so comment #1 doesn't apply in that case. bug is still the same though.

Comment 6 Jens Petersen 2008-10-20 07:00:45 UTC
*** Bug 467354 has been marked as a duplicate of this bug. ***

Comment 7 Cole Robinson 2008-10-20 14:02:37 UTC
*** Bug 467548 has been marked as a duplicate of this bug. ***

Comment 8 Cole Robinson 2008-10-20 14:20:00 UTC
Sorry about this, this was a stupid bug. Built in latest package:

$ koji latest-pkg dist-f10 python-virtinst
Build                                     Tag                   Built by
----------------------------------------  --------------------  ----------------
python-virtinst-0.400.0-3.fc10            dist-f10              crobinso

Closing as RAWHIDE, please reopen if anyone still sees this issue after updating.

Comment 9 Cole Robinson 2008-10-21 19:17:20 UTC
*** Bug 467896 has been marked as a duplicate of this bug. ***

Comment 10 David Bensimon 2008-10-21 20:33:40 UTC
Running Fedora release 9.92 (Rawhide) it seems that python-virtinst-0.400.0-2.fc10 is the latest version. Even if I try to update I cannot get 
python-virtinst-0.400.0-3.fc10. Instructions to do this world be helpful.

Comment 11 Sven Lankes 2008-10-21 21:18:25 UTC
The latest rawhide compose failed so you can either wait longer or get the rpm from koji: http://koji.fedoraproject.org/koji/buildinfo?buildID=66849

Comment 12 David Bensimon 2008-10-21 21:48:52 UTC
Thanks for your help, I actually got it working. I tried the following command which confirmed the newest version but did not download/install.

$ koji latest-pkg dist-f10 python-virtinst

So, I added the software sources:
Fedora - Rawhide - Debug
Fedora - Rawhide - Source

As well as what I had active:
Fedora - Rawhide - Development packages for the next Fedora release

Then I ran:
$ yum install python-virtinst

This updated to python-virtinst-0.400.0-3.fc10

Now to crush Bug # 464829 which is still an issue.