Commits

Brent Tubbs  committed 3f532cf

use put() instead of rsync for copying pip and distribute to remote host

  • Participants
  • Parent commits 45b52f2

Comments (0)

Files changed (1)

File silk/fabfile.py

 from fabric.api import *
 from fabric.colors import green, red, yellow
 from fabric.contrib.files import exists, contains, upload_template
-from fabric.contrib.project import rsync_project
 
 import silk.lib
 
     # Put all the prereq packages into /srv/pip_cache on the remote host, if
     # they're not already there.
     local_dir = pkg_resources.resource_filename('silk', 'prereqs')
-    # Ensure that local_dir ends in a slash so we just rsync the contents and
-    # not the whole folder.
-    if not local_dir.endswith('/'):
-        local_dir += '/'
+    files = pkg_resources.resource_listdir('silk', 'prereqs')
+
+    for f in files:
+        remote = posixpath.join('/tmp', f)
+        local = posixpath.join(local_dir, f)
+        if not exists(remote):
+            put(local, remote, use_sudo=True)
+
 
     tmpl_vars = vars()
     tmpl_vars.update(env)
-    tmpl_vars['dest'] = '%(user)s@%(host)s:/tmp/' % tmpl_vars
-    local('rsync -Orvz %(local_dir)s %(dest)s' % tmpl_vars)
 
     c = ("virtualenv --no-site-packages %(pyversion)s --extra-search-dir=/tmp "
          "--never-download %(envdir)s") % tmpl_vars