예제 #1
0
 def validate_connector(self, connector):
     """Check connector."""
     if 'FC' == self._protocol and 'wwpns' not in connector:
         msg = _LE('The connector does not contain the '
                   'required information: wwpns is missing')
         LOG.error(msg)
         raise exception.InvalidConnectorException(missing='wwpns')
예제 #2
0
 def validate_connector(self, connector):
     required = 'initiator' if self._protocol == 'iSCSI' else 'wwpns'
     if required not in connector:
         LOG.error(
             'The volume driver requires %(data)s '
             'in the connector.', {'data': required})
         raise exception.InvalidConnectorException(missing=required)
예제 #3
0
 def validate_connector(self, connector):
     """Check connector for at least one enabled iSCSI protocol."""
     if 'initiator' not in connector:
         LOG.error('The connector does not contain the required '
                   'information.')
         raise exception.InvalidConnectorException(
             missing='initiator')
예제 #4
0
파일: nvmeof.py 프로젝트: zjjfeng111/cinder
 def validate_connector(self, connector):
     if 'initiator' not in connector:
         LOG.error('The volume driver requires the NVMe initiator '
                   'name in the connector.')
         raise exception.InvalidConnectorException(
             missing='initiator')
     return True
예제 #5
0
 def validate_connector(self, connector):
     """Check for wwpns in connector."""
     if 'wwpns' not in connector:
         err_msg = (_LE('validate_connector: The FC driver requires the'
                        ' wwpns in the connector.'))
         LOG.error(err_msg)
         raise exception.InvalidConnectorException(missing='wwpns')
예제 #6
0
파일: fc.py 프로젝트: nikesh-biarca/cinder
 def validate_connector(self, connector):
     """Check connector for at least one enabled FC protocol."""
     if 'FC' == self._storage_protocol and 'wwpns' not in connector:
         LOG.error(
             _LE('The connector does not contain the required '
                 'information.'))
         raise exception.InvalidConnectorException(missing='wwpns')
예제 #7
0
파일: iscsi.py 프로젝트: sasimpson/cinder
 def validate_connector(self, connector):
     # NOTE(jdg): api passes in connector which is initiator info
     if 'initiator' not in connector:
         err_msg = (_LE('The volume driver requires the iSCSI initiator '
                        'name in the connector.'))
         LOG.error(err_msg)
         raise exception.InvalidConnectorException(missing='initiator')
     return True
예제 #8
0
 def validate_connector(self, connector):
     """Check connector for enabled protocol."""
     valid = False
     if 'iSCSI' == self._protocol and 'initiator' in connector:
         valid = True
     if not valid:
         LOG.error('The connector does not contain the '
                   'required information: initiator is missing')
         raise exception.InvalidConnectorException(missing=('initiator'))
예제 #9
0
    def validate_connector(self, connector):
        """Fail if connector doesn't contain all the data needed by the driver.

        :param connector: Connector information
        """

        required_data = ['host', 'initiator']
        for required in required_data:
            if required not in connector:
                LOG.error("The volume driver requires %(data)s "
                          "in the connector.", {'data': required})
                raise cinder_exception.InvalidConnectorException(
                    missing=required)
예제 #10
0
 def validate_connector(self, connector):
     """Check connector for at least one enabled protocol (iSCSI/FC)."""
     valid = False
     if ('iSCSI' in self._state['enabled_protocols'] and
             'initiator' in connector):
         valid = True
     if 'FC' in self._state['enabled_protocols'] and 'wwpns' in connector:
         valid = True
     if not valid:
         LOG.error(_LE('The connector does not contain the required '
                       'information.'))
         raise exception.InvalidConnectorException(
             missing='initiator or wwpns')
예제 #11
0
 def _storpool_client_id(self, connector):
     try:
         hostname = connector['host']
     except Exception as e:
         raise exception.InvalidConnectorException(missing='host')
     try:
         cfg = spconfig.SPConfig(section=hostname)
         return int(cfg['SP_OURID'])
     except KeyError:
         raise exception.StorPoolConfigurationMissing(section=hostname,
                                                      param='SP_OURID')
     except Exception as e:
         raise exception.StorPoolConfigurationInvalid(section=hostname,
                                                      param='SP_OURID',
                                                      error=e)
예제 #12
0
 def validate_connector(self, connector):
     """Check connector for at least one enabled FC protocol."""
     if 'wwpns' not in connector:
         LOG.error('The connector does not '
                   'contain the required information.')
         raise exception.InvalidConnectorException(missing='wwpns')