Bug 467228 - "UnboundLocalError: local variable 'verr' referenced before assign" when "--disk='path=/dev/VGMain/TestTmp'"
"UnboundLocalError: local variable 'verr' referenced before assign" when "--d...
Product: Fedora
Classification: Fedora
Component: python-virtinst (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Berrange
Fedora Extras Quality Assurance
: 467354 467491 467548 467896 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2008-10-16 10:17 EDT by Jan Hutař
Modified: 2008-10-21 17:48 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-10-20 10:20:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Hutař 2008-10-16 10:17:14 EDT
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 15:10:02 EDT
*** Bug 467491 has been marked as a duplicate of this bug. ***
Comment 2 Cole Robinson 2008-10-17 15:10:54 EDT
Fix is already upstream:


I'll pull this in for rawhide.
Comment 3 Cole Robinson 2008-10-17 15:11:51 EDT
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 15:27:58 EDT
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 16:31:47 EDT
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 03:00:45 EDT
*** Bug 467354 has been marked as a duplicate of this bug. ***
Comment 7 Cole Robinson 2008-10-20 10:02:37 EDT
*** Bug 467548 has been marked as a duplicate of this bug. ***
Comment 8 Cole Robinson 2008-10-20 10:20:00 EDT
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 15:17:20 EDT
*** Bug 467896 has been marked as a duplicate of this bug. ***
Comment 10 David Bensimon 2008-10-21 16:33:40 EDT
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 17:18:25 EDT
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 17:48:52 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.