Cleanup: Fix getting name from neutron resources
Some Neutron resources have names, while others don't. In some cases, it seems to depend on the Neutron version; in some versions ports have empty names, while in other versions they lack names entirely. This fixes all of those cases by defaulting to the blank string for resources that lack names. Implements: blueprint cleanup-refactoring Change-Id: Ia5537da52e105af593ace774889290b540df5726
This commit is contained in:
parent
589d8c81b4
commit
0f8861b855
@ -224,7 +224,7 @@ class NeutronMixin(SynchronizedDeletion, base.ResourceManager):
|
||||
return self.raw_resource["id"]
|
||||
|
||||
def name(self):
|
||||
return self.raw_resource["name"]
|
||||
return self.raw_resource.get("name", "")
|
||||
|
||||
def delete(self):
|
||||
delete_method = getattr(self._manager(), "delete_%s" % self._resource)
|
||||
|
Loading…
x
Reference in New Issue
Block a user