'Resize the image file on share to new size.'

def _resize_image_file(self, path, new_size):

    LOG.debug('Checking    file    for    resize')
    if self._is_file_size_equal(path, new_size):
        return
    else:
        LOG.info('Resizing    file    to    %sG', new_size)
        image_utils.resize_image(path, new_size, run_as_root=self._execute_as_root)
        if self._is_file_size_equal(path, new_size):
            return
        else:
            raise exception.InvalidResults(_('Resizing    image    file    failed.'))
