Permalink
Browse files

More debuggin around syncing.

  • Loading branch information...
1 parent ad3b315 commit c1a589dcc4b5435c8668a44a12a70ebebe71f944 @ericholscher ericholscher committed Oct 24, 2012
Showing with 17 additions and 5 deletions.
  1. +17 −5 readthedocs/core/utils.py
View
@@ -11,13 +11,18 @@ def copy_to_app_servers(full_build_path, target, mkdir=True):
"""
log.info("Copying %s to %s" % (full_build_path, target))
for server in settings.MULTIPLE_APP_SERVERS:
- ret = os.system("ssh %s@%s mkdir -p %s" % (getpass.getuser(), server, target))
+ mkdir_cmd = ("ssh %s@%s mkdir -p %s" % (getpass.getuser(), server, target))
+ ret = os.system(mkdir_cmd)
if ret != 0:
- log.error("COPY ERROR to app servers.")
- ret = os.system("rsync -e 'ssh -T' -av --delete %s/ %s@%s:%s" %
+ log.error("COPY ERROR to app servers:")
+ log.error(mkdir_cmd)
+
+ sync_cmd = ("rsync -e 'ssh -T' -av --delete %s/ %s@%s:%s" %
(full_build_path, getpass.getuser(), server, target))
+ ret = os.system(sync_cmd)
if ret != 0:
log.error("COPY ERROR to app servers.")
+ log.error(sync_cmd)
def copy_file_to_app_servers(from_file, to_file):
@@ -27,10 +32,17 @@ def copy_file_to_app_servers(from_file, to_file):
log.info("Copying %s to %s" % (from_file, to_file))
to_path = os.path.dirname(to_file)
for server in settings.MULTIPLE_APP_SERVERS:
- os.system("ssh %s@%s mkdir -p %s" % (getpass.getuser(), server, to_path))
- ret = os.system("rsync -e 'ssh -T' -av --delete %s %s@%s:%s" % (from_file, getpass.getuser(), server, to_file))
+ mkdir_cmd = ("ssh %s@%s mkdir -p %s" % (getpass.getuser(), server, to_path))
+ ret = os.system(mkdir_cmd)
+ if ret != 0:
+ log.error("COPY ERROR to app servers.")
+ log.error(sync_cmd)
+
+ sync_cmd = (rsync -e 'ssh -T' -av --delete %s %s@%s:%s" % (from_file, getpass.getuser(), server, to_file))
+ ret = os.system(sync_cmd)
if ret != 0:
log.error("COPY ERROR to app servers.")
+ log.error(sync_cmd)
def run_on_app_servers(command):

0 comments on commit c1a589d

Please sign in to comment.