'Ensure that the flags are set properly.'

def check_for_setup_error(self):

    LOG.debug('enter:    check_for_setup_error')
    if (self._state['system_name'] is None):
        exception_msg = _('Unable    to    determine    system    name.')
        raise exception.VolumeBackendAPIException(data=exception_msg)
    if (self._state['system_id'] is None):
        exception_msg = _('Unable    to    determine    system    id.')
        raise exception.VolumeBackendAPIException(data=exception_msg)
    if (not len(self._state['storage_nodes'])):
        msg = _('do_setup:    No    configured    nodes.')
        LOG.error(msg)
        raise exception.VolumeDriverException(message=msg)
    if (self.protocol not in self._state['enabled_protocols']):
        raise exception.InvalidInput(reason=(_('The    storage    device    does    not    support    %(prot)s.    Please    configure    the    device    to    support    %(prot)s    or    switch    to    a    driver    using    a    different    protocol.') % {'prot': self.protocol}))
    required_flags = ['san_ip', 'san_ssh_port', 'san_login', 'storwize_svc_volpool_name']
    for flag in required_flags:
        if (not self.configuration.safe_get(flag)):
            raise exception.InvalidInput(reason=(_('%s    is    not    set.') % flag))
    if (not (self.configuration.san_password or self.configuration.san_private_key)):
        raise exception.InvalidInput(reason=_('Password    or    SSH    private    key    is    required    for    authentication:    set    either    san_password    or    san_private_key    option.'))
    opts = self._helpers.build_default_opts(self.configuration)
    self._helpers.check_vdisk_opts(self._state, opts)
    LOG.debug('leave:    check_for_setup_error')
