Use py-sendfile in favor of pysendfile
authorNikos Skalkotos <skalkoto@grnet.gr>
Fri, 2 Nov 2012 11:08:32 +0000 (13:08 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Fri, 2 Nov 2012 11:08:32 +0000 (13:08 +0200)
The former is older but there are packages for it in distros like
Ubuntu.

image_creator/disk.py
setup.py

index aaee6ef..40e1316 100644 (file)
@@ -443,7 +443,8 @@ class DiskDevice(object):
                 progressbar.next()
                 while left > 0:
                     length = min(left, blocksize)
-                    sent = sendfile(dst.fileno(), src.fileno(), offset, length)
+                    _, sent = sendfile(dst.fileno(), src.fileno(), offset,
+                        length)
                     offset += sent
                     left -= sent
                     progressbar.goto((size - left) // MB)
index 58cecb9..542d985 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,7 @@ setup(
     license='BSD',
     packages=find_packages(),
     include_package_data=True,
-    install_requires=['sh', 'ansicolors', 'progress>=1.0.2', 'pysendfile'],
+    install_requires=['sh', 'ansicolors', 'progress>=1.0.2', 'py-sendfile'],
     entry_points={
         'console_scripts': [
                 'snf-image-creator = image_creator.main:main',