Merge PR #28473 into master

* refs/pull/28473/head:
	cephfs-shell: Catch OSError exceptions in lcd

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
Patrick Donnelly 2019-06-12 14:30:45 -07:00
commit 2be64ebdee
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB

View File

@ -1007,13 +1007,11 @@ sub-directories, files')
"""
Moves into the given local directory
"""
path = os.path.expanduser(args.path)
if os.path.isdir(path):
os.chdir(path)
# self.poutput(get_all_possible_paths(args.path))
else:
self.poutput("%s: no such directory" % path)
try:
os.chdir(os.path.expanduser(args.path))
except OSError as e:
self.perror("Cannot change to {}: {}".format(e.filename,
e.strerror), False)
def complete_lls(self, text, line, begidx, endidx):
"""