summaryrefslogtreecommitdiff
path: root/openstackclient/network
diff options
context:
space:
mode:
authorTang Chen <tangchen@cn.fujitsu.com>2015-11-27 16:52:56 +0800
committerTang Chen <tangchen@cn.fujitsu.com>2015-11-27 16:52:56 +0800
commita2047d3f9fb36d67d4897d1bf976b5a7eb3f610f (patch)
treec3525557e28e70ff7c0533036281a59c35eec1d1 /openstackclient/network
parentc48afe6032ad53fcdc12c749adfe2d0f006fef14 (diff)
downloadpython-openstackclient-a2047d3f9fb36d67d4897d1bf976b5a7eb3f610f.tar.gz
Trivial: Fix typo in find() in network.
Change-Id: Ic54fbb9160adefe3d025d537125e125128f75ee6
Diffstat (limited to 'openstackclient/network')
-rw-r--r--openstackclient/network/common.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/openstackclient/network/common.py b/openstackclient/network/common.py
index bd6203bd..31faef25 100644
--- a/openstackclient/network/common.py
+++ b/openstackclient/network/common.py
@@ -27,7 +27,8 @@ def find(client, resource, resources, name_or_id, name_attr='name'):
n = find(netclient, 'network', 'networks', 'matrix')
"""
list_method = getattr(client, "list_%s" % resources)
- # Search for by name
+
+ # Search by name
kwargs = {name_attr: name_or_id, 'fields': 'id'}
data = list_method(**kwargs)
info = data[resources]
@@ -36,7 +37,8 @@ def find(client, resource, resources, name_or_id, name_attr='name'):
if len(info) > 1:
msg = "More than one %s exists with the name '%s'."
raise exceptions.CommandError(msg % (resource, name_or_id))
- # Search for by id
+
+ # Search by id
data = list_method(id=name_or_id, fields='id')
info = data[resources]
if len(info) == 1: