From 669840abc037fc8c49255a68bebae9a8279eac86 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Tue, 12 May 2020 13:12:15 -0600 Subject: [PATCH] cephadm: return absolute path from pathify 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 --- src/cephadm/cephadm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 57d4b556d13de..b78758b491038 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -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: -- 2.39.5