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

Haiyang Dong hadong at redhat.com
Tue Jun 25 04:14:31 UTC 2013


Hey Ricky,

I have added your patch into the latest patchset of
http://gerrit.ovirt.org/#/c/16054/

thanks,
hadong


----- Original Message -----
From: "Bohai (ricky)" <bohai at huawei.com>
To: node-devel at ovirt.org
Cc: "Luohao (A)" <luohao916 at huawei.com>, "Haofeng" <haofeng at huawei.com>, "boh ricky" <boh.ricky at gmail.com>
Sent: Tuesday, June 25, 2013 11:20:56 AM
Subject: [node-devel] problem about ovirt-node-upgrade

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

_______________________________________________
node-devel mailing list
node-devel at ovirt.org
http://lists.ovirt.org/mailman/listinfo/node-devel



More information about the node-devel mailing list