Commit 9439cdb2 authored by Marcello Golfieri's avatar Marcello Golfieri

Revert "fixed logic error in checking sync was successful"

This reverts commit f9c07edf067e9ecdb3b8483131649d7af1aa18e2.
parent b1a2890c
......@@ -33,19 +33,18 @@ class Migrator(object):
def migrate(self):
command = (
"gdrive sync upload --keep-local --delete-extraneous "
"gdrive sync upload --keep-local "
+ self.src.AFS_USER_HOME
+ " "
+ self.dest.DEST_DIR_ID
)
exit_code = os.system(command)
if exit_code != 0:
logger.debug('Failed command {} to migrate {} to destination dir on gDrive "{}" ({}) with exit code {}:'.format(
os.system(command)
logger.debug(
'Failed command {} to migrate {} to destination dir on gDrive "{}" ({}):'.format(
command,
self.src.AFS_USER_HOME,
self.dest.DEST_DIR,
self.dest.DEST_DIR_ID,
exit_code
)
)
# gdrive sync upload --keep-local /afs/ir/users/g/o/golfieri/ 18tOx4OdFPyIRkkokmz3Z1Ln0_XbPcAw5
......@@ -58,8 +57,7 @@ class SuDatastore(object):
OS_SPECIFICS = {
"Darwin": {
"HOME_PATH": "/afs/ir/users/",
"CHECK_SYNCER_APP": "which rclone",
"INSTALL_SYNCER_APP": "brew install rclone",
"GDRIVE_INSTALL_STEPS": 'Run "brew install gdrive" in your shell',
"DEFAULT_BROWSER_CMD": "open",
}
}
......@@ -137,8 +135,8 @@ class SuGDrive(SuDatastore):
super().__init__(sunet)
if subprocess.call(["which", "gdrive"]) != 0:
raise Exception(
'Rclone app not installed, please install it. Run "{0}" in a shell'.format(
self.os_spec("INSTALL_SYNCER_APP")
'Gdrive CLI app not installed, please install it. {0}"'.format(
self.os_spec("GDRIVE_INSTALL_STEPS")
)
)
if not os.path.exists(os.path.join(self.HOME + ".gdrive/token_v2.json")):
......
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