[node-patches] Change in ovirt-node[master]: ovirt-node-upgrade : remove /data/tmpiso_* during cleanup
hadong0720 at gmail.com
hadong0720 at gmail.com
Thu Jun 6 08:55:14 UTC 2013
hadong has uploaded a new change for review.
Change subject: ovirt-node-upgrade : remove /data/tmpiso_* during cleanup
......................................................................
ovirt-node-upgrade : remove /data/tmpiso_* during cleanup
Previously the function "_cleanup()" for ovirt-node-upgrade tools
didn't remove /data/tmpiso_* during cleanup.
Now it works.
Change-Id: I14d8782c353cccf88d31abdda3d31f1f56f77736
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=971299
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M scripts/ovirt-node-upgrade.py
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/04/15404/1
diff --git a/scripts/ovirt-node-upgrade.py b/scripts/ovirt-node-upgrade.py
index fbe7c5f..ecd5be6 100755
--- a/scripts/ovirt-node-upgrade.py
+++ b/scripts/ovirt-node-upgrade.py
@@ -77,6 +77,7 @@
self._options = None
self._python_lib = None
self._tmp_python_path = None
+ self.iso_tmp = None
self._tmp_dir = tempfile.mkdtemp(dir="/data")
lock_fd, self._lock_file = tempfile.mkstemp(prefix=".ovirtupgrade.")
os.close(lock_fd)
@@ -207,6 +208,8 @@
self._system(which("umount"), dir)
os.remove(self._lock_file)
shutil.rmtree(self._tmp_dir)
+ if os.path.exists(self.iso_tmp):
+ os.remove(self.iso_tmp)
except:
self._logger.warning("Cleanup Failed")
self._logger.debug('exception', exc_info=True)
@@ -279,6 +282,7 @@
dir="/data",
prefix="tmpiso_",
)
+ self.iso_tmp = self._options.iso_file
os.close(iso_fd)
self._logger.debug("Using temporary ISO file: {iso}\n".format
(iso=self._options.iso_file))
--
To view, visit http://gerrit.ovirt.org/15404
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I14d8782c353cccf88d31abdda3d31f1f56f77736
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>
More information about the node-patches
mailing list