Use flavors.get when finding with id
flavors.get is more efficient than flavors.find when looking for falvors with id. Change-Id: I82a12e5287766d88a815c15a68515b3918a63988
This commit is contained in:
@@ -231,7 +231,7 @@ class NovaClientPlugin(client_plugin.ClientPlugin):
|
||||
:returns: the id of :flavor:
|
||||
"""
|
||||
try:
|
||||
return self.client().flavors.find(id=flavor).id
|
||||
return self.client().flavors.get(flavor).id
|
||||
except exceptions.NotFound:
|
||||
return self.client().flavors.find(name=flavor).id
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ class TroveClientPlugin(client_plugin.ClientPlugin):
|
||||
:returns: the id of :flavor:
|
||||
"""
|
||||
try:
|
||||
return self.client().flavors.find(id=flavor).id
|
||||
return self.client().flavors.get(flavor).id
|
||||
except exceptions.NotFound:
|
||||
return self.client().flavors.find(name=flavor).id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user