]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: return absolute path from pathify 35030/head
authorMichael Fritch <mfritch@suse.com>
Tue, 12 May 2020 19:12:15 +0000 (13:12 -0600)
committerMichael Fritch <mfritch@suse.com>
Tue, 12 May 2020 22:55:47 +0000 (16:55 -0600)
normalizes the user defined paths a bit better to avoid inconsistent
results with os.path.basename(), os.path.join(), etc.

For example:
$ cephadm shell --mount ~/

Signed-off-by: Michael Fritch <mfritch@suse.com>
src/cephadm/cephadm

index 57d4b556d13de32f60aaaf5f6419f7215620e026..b78758b4910384abc6efcaa83a3a84f572d07d62 100755 (executable)
@@ -930,9 +930,8 @@ def read_config(fn):
 
 def pathify(p):
     # type: (str) -> str
-    if not p.startswith('/'):
-        return os.path.join(os.getcwd(), p)
-    return p
+    p = os.path.expanduser(p)
+    return os.path.abspath(p)
 
 def get_file_timestamp(fn):
     try: