On Friday August 14th. from 9 p.m. to 9:30 p.m., we will upgrade GitLab software and its cloud platform release. Service may not be available during this maintenance window. Please schedule your work accordingly.

Commit 26aaa508 authored by Marcello Golfieri's avatar Marcello Golfieri

made instructions clearer, and fixed an error in detecting the existence of the .gdrive token

parent e06a9c0b
......@@ -36,7 +36,7 @@ class Migrator(object):
# Usually users have a .backup folder that doesn't play well with gdrive client, and .gdriveignore does not work.
BACKUP_ENABLED = (
True
if os.path.exists(os.path.join(self.src.AFS_USER_HOME + ".backup"))
if os.path.exists(os.path.join(self.src.AFS_USER_HOME, ".backup"))
else False
)
if BACKUP_ENABLED:
......@@ -180,6 +180,19 @@ class SuGDrive(SuDatastore):
super().__init__(sunet)
self.OS_SPECIFICS["Darwin"].update(
{
"MISSING_TOKEN": """You don't seem to have yet granted access to your Stanford gDrive. Please allow access
in the browser window, and then keep following the instructions here.""",
"HOW_TO_APPLY_TOKEN": """After you have copied the token from the browser window that is going to be displayed after \n \
you allowed access, run:
gdrive list
from your command line and paste it when asked.
Press Enter to continue. Re-run me later as:
./suafs2gdrive.py -u
and I will sync your home folder.""",
"GDRIVE_INSTALL_STEPS": 'Run "brew install gdrive" in your shell',
"WHICH_GDRIVE": "which -s gdrive",
"GDRIVE_LIST": "gdrive list",
......@@ -194,13 +207,13 @@ class SuGDrive(SuDatastore):
self.os_spec("GDRIVE_INSTALL_STEPS")
)
)
if not os.path.exists(os.path.join(self.HOME + ".gdrive/token_v2.json")):
if not os.path.exists(os.path.join(self.HOME, ".gdrive/token_v2.json")):
print(self.os_spec("MISSING_TOKEN"))
try:
self.shell_output(self.os_spec("GDRIVE_LIST"), input=b"\n")
except subprocess.CalledProcessError as e:
print(
'After you have copied the token from the browser window that just displayed, run "gdrive list" from your command line and paste it when asked'
)
print(self.os_spec("HOW_TO_APPLY_TOKEN"))
input()
auth_url = re.search(
rb"Go to the following url in your browser:\n(.*)$",
e.output,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment