'Verify that requirements are in place to use LVM driver.'

def check_for_setup_error(self):

    if (self.vg is None):
        root_helper = utils.get_root_helper()
        lvm_conf_file = self.configuration.lvm_conf_file
        if (lvm_conf_file.lower() == 'none'):
            lvm_conf_file = None
        try:
            lvm_type = self.configuration.lvm_type
            if (lvm_type == 'auto'):
                if volutils.supports_thin_provisioning():
                    lvm_type = 'thin'
                else:
                    lvm_type = 'default'
            self.vg = lvm.LVM(self.configuration.volume_group, root_helper, lvm_type=lvm_type, executor=self._execute, lvm_conf=lvm_conf_file, suppress_fd_warn=self.configuration.lvm_suppress_fd_warnings)
        except exception.VolumeGroupNotFound:
            message = (_('Volume    Group    %s    does    not    exist') % self.configuration.volume_group)
            raise exception.VolumeBackendAPIException(data=message)
    vg_list = volutils.get_all_volume_groups(self.configuration.volume_group)
    vg_dict = next((vg for vg in vg_list if (vg['name'] == self.vg.vg_name)))
    if (vg_dict is None):
        message = (_('Volume    Group    %s    does    not    exist') % self.configuration.volume_group)
        raise exception.VolumeBackendAPIException(data=message)
    pool_name = ('%s-pool' % self.configuration.volume_group)
    if (self.configuration.lvm_type == 'auto'):
        self.vg.update_volume_group_info()
        self.configuration.lvm_type = 'default'
        if volutils.supports_thin_provisioning():
            if (self.vg.get_volume(pool_name) is not None):
                LOG.info('Enabling    LVM    thin    provisioning    by    default    because    a    thin    pool    exists.')
                self.configuration.lvm_type = 'thin'
            elif (len(self.vg.get_volumes()) == 0):
                LOG.info('Enabling    LVM    thin    provisioning    by    default    because    no    LVs    exist.')
                self.configuration.lvm_type = 'thin'
    if (self.configuration.lvm_type == 'thin'):
        if (not volutils.supports_thin_provisioning()):
            message = _('Thin    provisioning    not    supported    on    this    version    of    LVM.')
            raise exception.VolumeBackendAPIException(data=message)
        if (self.vg.get_volume(pool_name) is None):
            try:
                self.vg.create_thin_pool(pool_name)
            except processutils.ProcessExecutionError as exc:
                exception_message = (_('Failed    to    create    thin    pool,    error    message    was:    %s') % six.text_type(exc.stderr))
                raise exception.VolumeBackendAPIException(data=exception_message)
        self._sparse_copy_volume = True
