Revision 74b7c6dc kamaki/clients/utils/__init__.py

b/kamaki/clients/utils/__init__.py
94 94

  
95 95
def readall(openfile, size, retries=7):
96 96
    """Read a file until size is reached"""
97
    from os import fstat
98
    actual_size = fstat(openfile.fileno()).st_size - openfile.tell()
99
    size = actual_size if actual_size < size else size
97 100
    remains = size if size > 0 else 0
98 101
    buf = ''
99 102
    for i in range(retries):

Also available in: Unified diff