Correct search opt param in SessionList
There are differences between session and other tables(
job, atcion, backup, client):
for example:
--search '{"match": [{"id": "820e30c284fb4d"}]}'
1.It is coversed to '{"match": [{"id": "820e30c284fb4d"}]}'
in session
2.It is coversed to {'match': [{'_all': '{"match":
[{"id": "820e30c284fb4d"}]}}]}' in other talbes
It can lead to mistakes:
ERROR freezer-api File "/opt/stack/freezer-api/freezer_api/
storage/elasticv2.py", line 47, in get_base_search_filter
ERROR freezer-api match_list = [{"match": m} for m
in search.get('match', [])]
ERROR freezer-api AttributeError: 'unicode' object
has no attribute 'get'
Change-Id: Id9b918208caef1f3b6d31e780a951b0ab6f5e98f
This commit is contained in:
@@ -100,10 +100,11 @@ class SessionList(lister.Lister):
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
search = utils.prepare_search(parsed_args.search)
|
||||
sessions = self.app.client.sessions.list_all(
|
||||
limit=parsed_args.limit,
|
||||
offset=parsed_args.offset,
|
||||
search=parsed_args.search
|
||||
search=search
|
||||
)
|
||||
|
||||
# Print empty table if no sessions found
|
||||
|
||||
@@ -102,10 +102,11 @@ class SessionList(lister.Lister):
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
search = utils.prepare_search(parsed_args.search)
|
||||
sessions = self.app.client.sessions.list_all(
|
||||
limit=parsed_args.limit,
|
||||
offset=parsed_args.offset,
|
||||
search=parsed_args.search
|
||||
search=search
|
||||
)
|
||||
|
||||
# Print empty table if no sessions found
|
||||
|
||||
Reference in New Issue
Block a user