Commit b1a2890c authored by Marcello Golfieri's avatar Marcello Golfieri

fixed logic error in checking sync was successful

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