'Return int representation of frag_index, or raise a DiskFileError if
frag_index is not a whole number.
:param frag_index: a fragment archive index'

def validate_fragment_index(self, frag_index):

    try:
        frag_index = int(str(frag_index))
    except (ValueError, TypeError) as e:
        raise DiskFileError(('Bad    fragment    index:    %s:    %s' % (frag_index, e)))
    if (frag_index < 0):
        raise DiskFileError(('Fragment    index    must    not    be    negative:    %s' % frag_index))
    return frag_index
