'Create a new _DiskImage object instance
:param image: instance of nova.virt.image.model.Image
:param partition: the partition number within the image
:param mount_dir: the directory to mount the image on'

def __init__(self, image, partition=None, mount_dir=None):

    self.partition = partition
    self.mount_dir = mount_dir
    self.image = image
    self._mkdir = False
    self._mounter = None
    self._errors = []
    if mount_dir:
        device = self._device_for_path(mount_dir)
        if device:
            self._reset(device)
        else:
            LOG.debug('No    device    found    for    path:    %s', mount_dir)
