Send 'changes-since' instead of 'changes_since' query parameter
Per API reference, only 'changes-since' is accepted and the variant with underscore is ignored, making the CLI functionality broken. [dtroyer] added release note and fixed unit tests. Change-Id: I0c596531a8af03da17d5ce39d75b12e941403aa5 Closes-Bug: 1732216
This commit is contained in:
parent
4742d4df70
commit
116526275d
@ -1056,17 +1056,18 @@ class ListServer(command.Lister):
|
|||||||
'all_tenants': parsed_args.all_projects,
|
'all_tenants': parsed_args.all_projects,
|
||||||
'user_id': user_id,
|
'user_id': user_id,
|
||||||
'deleted': parsed_args.deleted,
|
'deleted': parsed_args.deleted,
|
||||||
'changes_since': parsed_args.changes_since,
|
'changes-since': parsed_args.changes_since,
|
||||||
}
|
}
|
||||||
LOG.debug('search options: %s', search_opts)
|
LOG.debug('search options: %s', search_opts)
|
||||||
|
|
||||||
if search_opts['changes_since']:
|
if search_opts['changes-since']:
|
||||||
try:
|
try:
|
||||||
timeutils.parse_isotime(search_opts['changes_since'])
|
timeutils.parse_isotime(search_opts['changes-since'])
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise exceptions.CommandError(_('Invalid changes-since value:'
|
raise exceptions.CommandError(
|
||||||
' %s') % search_opts['changes'
|
_('Invalid changes-since value: %s') %
|
||||||
'_since'])
|
search_opts['changes-since']
|
||||||
|
)
|
||||||
|
|
||||||
if parsed_args.long:
|
if parsed_args.long:
|
||||||
columns = (
|
columns = (
|
||||||
|
@ -1584,7 +1584,7 @@ class TestServerList(TestServer):
|
|||||||
'all_tenants': False,
|
'all_tenants': False,
|
||||||
'user_id': None,
|
'user_id': None,
|
||||||
'deleted': False,
|
'deleted': False,
|
||||||
'changes_since': None,
|
'changes-since': None,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Default params of the core function of the command in the case of no
|
# Default params of the core function of the command in the case of no
|
||||||
@ -1791,7 +1791,7 @@ class TestServerList(TestServer):
|
|||||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||||
columns, data = self.cmd.take_action(parsed_args)
|
columns, data = self.cmd.take_action(parsed_args)
|
||||||
|
|
||||||
self.search_opts['changes_since'] = '2016-03-04T06:27:59Z'
|
self.search_opts['changes-since'] = '2016-03-04T06:27:59Z'
|
||||||
self.search_opts['deleted'] = True
|
self.search_opts['deleted'] = True
|
||||||
self.servers_mock.list.assert_called_with(**self.kwargs)
|
self.servers_mock.list.assert_called_with(**self.kwargs)
|
||||||
|
|
||||||
|
5
releasenotes/notes/bug-1732216-b41bfedebff911e1.yaml
Normal file
5
releasenotes/notes/bug-1732216-b41bfedebff911e1.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fix the operation of the ``--changes-since`` option to the ``server list`` command.
|
||||||
|
[Bug `1732216 <https://bugs.launchpad.net/python-openstackclient/+bug/1732216>`_]
|
Loading…
Reference in New Issue
Block a user