]> git-server-git.apps.pok.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)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 20 Mar 2013 13:01:02 +0000 (14:01 +0100)
Replace 'canonical' variable with 'path' since canonical doesn't
exist in this function.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/ceph-disk

index f7a478f9efd91079102d5c53b611081c0d6ce5f3..a121b22e80825f36b0caa07649ca6ef9a3b77988 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: