Fix unexpected output of pools()

As of now, pools() of v1/client.py return
list of pools whose all attributes(like uri, weight etc)
set to None (unexpectedly).

This patch fixes the issue, now all attributes of pool
should be set to their respective values instead of None.

Change-Id: I083fa853cb3712a7fc161521663a5b7ec520254f
Closes-Bug: #1519614
This commit is contained in:
Md Nadeem 2015-11-25 15:33:18 +09:00 committed by Fei Long Wang
parent 808ea8b71a
commit 3a86c2ae48

View File

@ -21,15 +21,14 @@ class Pool(object):
def __init__(self, client, name, def __init__(self, client, name,
weight=None, uri=None, weight=None, uri=None,
group=None, group=None, auto_create=True,
auto_create=True, **options): **kwargs):
self.client = client self.client = client
self.uri = uri self.uri = uri
self.name = name self.name = name
self.weight = weight self.weight = weight
self.group = group self.group = group
self.options = options self.options = kwargs.get("options", {})
if auto_create: if auto_create:
self.ensure_exists() self.ensure_exists()
@ -78,4 +77,5 @@ class Pool(object):
def create_object(parent): def create_object(parent):
return lambda args: Pool(parent, args["name"], auto_create=False) return lambda kwargs: Pool(parent, kwargs.pop('name'),
auto_create=False, **kwargs)