From df7e06353bcd1c48304884384e5d8575747a3b7a Mon Sep 17 00:00:00 2001 From: Dan Kenigsberg Date: Wed, 4 Jul 2012 17:25:55 +0300 Subject: [PATCH 39/40] configNet: clear up atomicBackup arg Apparently, os.path.join('/a/b/', '/a/b/c') == '/a/b/c'. Let us not trust this peculiarity, and have atomicBackup expect a full path to the config file. Change-Id: Id4f4fc8dd1db785837d868a45787b3fa5be901a6 Signed-off-by: Dan Kenigsberg Reviewed-on: http://gerrit.ovirt.org/5953 Reviewed-by: Igor Lvovsky Reviewed-on: http://gerrit.ovirt.org/6211 --- vdsm/configNetwork.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py index d8cad5d..dbec079 100755 --- a/vdsm/configNetwork.py +++ b/vdsm/configNetwork.py @@ -168,11 +168,11 @@ class ConfigWriter(object): def _atomicBackup(self, filename): """Backs up configuration to memory, for a later rollback in case of error.""" - confFile = os.path.join(netinfo.NET_CONF_DIR, filename) - if confFile not in self._backups: + + if filename not in self._backups: try: - self._backups[confFile] = open(confFile).read() - logging.debug("Backed up %s" % confFile) + self._backups[filename] = open(filename).read() + logging.debug("Backed up %s", filename) except IOError: pass -- 1.7.7.6