示例#1
0
 def _storpool_client_id(self, connector):
     hostname = connector['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)
示例#2
0
 def _storpool_client_id(self, connector):
     hostname = connector['host']
     if hostname == self.host or hostname == CONF.host:
         hostname = platform.node()
     try:
         cfg = spconfig.SPConfig(section=hostname)
         return int(cfg['SP_OURID'])
     except KeyError:
         return 65
     except Exception as e:
         raise StorPoolConfigurationInvalid(
             section=hostname, param='SP_OURID', error=e)
示例#3
0
 def _storpool_client_id(self, connector):
     try:
         hostname = connector['host']
     except Exception as e:
         raise exception.VolumeDriverException(
             _('The connector does not contain the required information.'))
     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)