provision: Give concrete NFS error message on older OSX versions.

This commit is contained in:
Joshua Pan 2018-05-12 22:21:02 -04:00 committed by Tim Abbott
parent 184bd8304e
commit 073ecaac66
1 changed files with 8 additions and 1 deletions

View File

@ -17,7 +17,14 @@ from zulip_bots.lib import get_bots_directory_path
bots_dir = os.path.join(settings.STATIC_ROOT, 'generated/bots')
if os.path.isdir(bots_dir):
# delete old static files, they could be outdated
shutil.rmtree(bots_dir)
try:
shutil.rmtree(bots_dir)
except OSError:
print("There was a permission error with Vagrant's NFS file sharing on old versions of " +
"OSX. You can fix this by upgrading to the latest OSX High Sierra, or work around it " +
"by giving read/write permissions to your /zulip folder to everyone.")
sys.exit(1)
os.makedirs(bots_dir, exist_ok=True)