From: Danny Al-Gaaf Date: Wed, 20 Mar 2013 13:01:02 +0000 (+0100) Subject: ceph-disk: fix adjust_symlink() replace 'canonical' with 'path' X-Git-Tag: v0.62~188^2^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a27cb85b21610b4a9f8eb24f8f6cd04902349728;p=ceph.git ceph-disk: fix adjust_symlink() replace 'canonical' with 'path' Replace 'canonical' variable with 'path' since canonical doesn't exist in this function. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/ceph-disk b/src/ceph-disk index f7a478f9efd9..a121b22e8082 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -743,19 +743,19 @@ def adjust_symlink(target, path): create = True if os.path.lexists(path): try: - mode = os.lstat(canonical).st_mode + mode = os.lstat(path).st_mode if stat.S_ISREG(mode): - log.debug('Removing old file %s', canonical) - os.unlink(canonical) + log.debug('Removing old file %s', path) + os.unlink(path) elif stat.S_ISLNK(mode): - old = os.readlink(canonical) + old = os.readlink(path) if old != journal: - log.debug('Removing old symlink %s -> %s', canonical, old) - os.unlink(canonical) + log.debug('Removing old symlink %s -> %s', path, old) + os.unlink(path) else: create = False except: - raise Error('unable to remove (or adjust) old file (symlink)', canonical) + raise Error('unable to remove (or adjust) old file (symlink)', path) if create: log.debug('Creating symlink %s -> %s', path, target) try: