]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: fix adjust_symlink() replace 'canonical' with 'path'
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 20 Mar 2013 13:01:02 +0000 (14:01 +0100)
committerSage Weil <sage@inktank.com>
Fri, 26 Apr 2013 20:40:05 +0000 (13:40 -0700)
Replace 'canonical' variable with 'path' since canonical doesn't
exist in this function.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit a27cb85b21610b4a9f8eb24f8f6cd04902349728)

src/ceph-disk

index 741b8532d852b5d6ad4899a761c7fe7279fc04d4..cc473fd72722c62b3153fbd7c8789c6fe760f8a8 100755 (executable)
@@ -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: