[node-devel] problem about ovirt-node-upgrade

Bohai (ricky) bohai at huawei.com
Tue Jun 25 03:20:56 UTC 2013


Hi,

When I try to use ovirt-node-upgrade command, an error like below occurred.

----------------error message----------------------------------
virt-node-upgrade.UpgradeTool: WARNING  Cleanup Failed
WARNING:ovirt-node-upgrade.UpgradeTool:Cleanup Failed
DEBUG:ovirt-node-upgrade.UpgradeTool:exception
Traceback (most recent call last):
  File "/sbin/ovirt-node-upgrade", line 211, in _cleanup
    if os.path.exists(self.iso_tmp):
  File "/usr/lib64/python2.7/genericpath.py", line 18, in exists
    os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found
------------------------------------------------------------------------

I saw the code .The reason may be that self.iso_tmp is None sometimes.
So I think it's better to confirm whether self.iso_tmp is None before run function " os.path.exists ".
I try to fix it and test it. The command seem ok now.

diff --git a/scripts/ovirt-node-upgrade.py b/scripts/ovirt-node-upgrade.py
index ecd5be6..0503069 100755
--- a/scripts/ovirt-node-upgrade.py
+++ b/scripts/ovirt-node-upgrade.py
@@ -208,7 +208,7 @@ class UpgradeTool(Base):
                 self._system(which("umount"), dir)
             os.remove(self._lock_file)
             shutil.rmtree(self._tmp_dir)
-            if os.path.exists(self.iso_tmp):
+            if self.iso_tmp and os.path.exists(self.iso_tmp):
                 os.remove(self.iso_tmp)
         except:
             self._logger.warning("Cleanup Failed")


Best regards to you.
Ricky




More information about the node-devel mailing list