When it happened, the environment is: Node: OS: Fedora 16 VDSM: from git source(931a43ea0c847e6c843aa14573318e35fc6c043d) engine-core: OS: Fedora 16 Engine-Core: from git source( d64bc2b8f8ba99593f8cda0e511789c64ffb1be4 )
The attachment is the vdsm log when it happened.However, I couldn't reproduce it using the same environment now.I will continue to try to reproduce it. If any update, I comment it.
2011/12/6 Dan Kenigsberg danken@redhat.com
On Tue, Dec 06, 2011 at 02:10:48PM +0800, Jarod. w wrote:
Hi, All
The patch will fix error message "UnboundLocalError: local variable
'path' referenced before assignment" when running vm.
thanks.
From 1f99c4f5b04100231c8712f2caf97d11dcc9eb37 Mon Sep 17 00:00:00 2001
From: "jarod.w" work.iec23801@gmail.com Date: Tue, 6 Dec 2011 14:00:58 +0800 Subject: [PATCH] Fix error message "UnboundLocalError: local variable
'path'
referenced before assignment" when running vm.
When the drive argument can't be parsed in _prepareVolumePath function,
the
self.log.info statement will report the error in the
/var/log/vdsm/vdsm.log
because the local variable 'path' isn't assigned. The patch adds the else statement to assign the local variable.
vdsm/clientIF.py | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py index 9d6b942..10e3a24 100644 --- a/vdsm/clientIF.py +++ b/vdsm/clientIF.py @@ -590,6 +590,9 @@ class clientIF: path = drive elif os.path.exists(drive): path = drive
else:
self.log.info("invaild drive : %s" % str(drive) )
path = '' self.log.info("prepared volume path: %s" % path) return path
Jarod, your patch seems fine (though using str() is supefluous), but I'm interested to know why did the 'drive' argument failed parsing?
I would also appreciate if you send patches for review in gerrit.ovirt.org .
Regards,
Dan.