]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
NeutronManager: Remove explicit check of the existence of an attribute
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Wed, 11 Jun 2014 07:15:20 +0000 (16:15 +0900)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Wed, 11 Jun 2014 18:02:13 +0000 (03:02 +0900)
To simplify the code a little.  No functional changes.

Change-Id: I862bb2a3d2bf808826c31888f3401709a1be086f

neutron/manager.py

index 10e494114429169abc26c25cf0cfa58f58bb5bc6..699af4e7a9a9fdb9e96d9ebb1127e8afac375d06 100644 (file)
@@ -143,9 +143,8 @@ class NeutronManager(object):
         LOG.debug(_("Loading services supported by the core plugin"))
 
         # supported service types are derived from supported extensions
-        if not hasattr(self.plugin, "supported_extension_aliases"):
-            return
-        for ext_alias in self.plugin.supported_extension_aliases:
+        for ext_alias in getattr(self.plugin,
+                                 "supported_extension_aliases", []):
             if ext_alias in constants.EXT_TO_SERVICE_MAPPING:
                 service_type = constants.EXT_TO_SERVICE_MAPPING[ext_alias]
                 self.service_plugins[service_type] = self.plugin