コード例 #1
0
ファイル: plugin.py プロジェクト: Karbit/neutron
 def _get_provider_name(self, context, pool):
     if "provider" in pool and pool["provider"] != attrs.ATTR_NOT_SPECIFIED:
         provider_name = pconf.normalize_provider_name(pool["provider"])
         self.validate_provider(provider_name)
         return provider_name
     else:
         if not self.default_provider:
             raise pconf.DefaultServiceProviderNotFound(service_type=constants.LOADBALANCER)
         return self.default_provider
コード例 #2
0
 def _get_provider_name(self, context, pool):
     if ('provider' in pool
             and pool['provider'] != attrs.ATTR_NOT_SPECIFIED):
         provider_name = pconf.normalize_provider_name(pool['provider'])
         self.validate_provider(provider_name)
         return provider_name
     else:
         if not self.default_provider:
             raise pconf.DefaultServiceProviderNotFound(
                 service_type=constants.LOADBALANCER)
         return self.default_provider
コード例 #3
0
ファイル: plugin.py プロジェクト: CingHu/neutron-ustack
 def _get_provider_name(self, entity):
     if ('provider' in entity and
             entity['provider'] != attrs.ATTR_NOT_SPECIFIED):
         provider_name = pconf.normalize_provider_name(entity['provider'])
         self.validate_provider(provider_name)
         return provider_name
     else:
         if not self.default_provider:
             raise pconf.DefaultServiceProviderNotFound(
                 service_type=constants.LOADBALANCERV2)
         return self.default_provider
コード例 #4
0
ファイル: plugin.py プロジェクト: lezbar/neutron-lbaas
 def _get_provider_name(self, entity):
     if ('provider' in entity and
             entity['provider'] != attrs.ATTR_NOT_SPECIFIED):
         provider_name = pconf.normalize_provider_name(entity['provider'])
         del entity['provider']
         self.validate_provider(provider_name)
         return provider_name
     else:
         if not self.default_provider:
             raise pconf.DefaultServiceProviderNotFound(
                 service_type=constants.LOADBALANCER)
         del entity['provider']
         return self.default_provider