Merge "Send 'changes-since' instead of 'changes_since' query parameter"

This commit is contained in:
Zuul 2017-12-13 02:57:49 +00:00 committed by Gerrit Code Review
commit 8c5f755569
3 changed files with 14 additions and 8 deletions

View File

@ -1056,17 +1056,18 @@ class ListServer(command.Lister):
'all_tenants': parsed_args.all_projects,
'user_id': user_id,
'deleted': parsed_args.deleted,
'changes_since': parsed_args.changes_since,
'changes-since': parsed_args.changes_since,
}
LOG.debug('search options: %s', search_opts)
if search_opts['changes_since']:
if search_opts['changes-since']:
try:
timeutils.parse_isotime(search_opts['changes_since'])
timeutils.parse_isotime(search_opts['changes-since'])
except ValueError:
raise exceptions.CommandError(_('Invalid changes-since value:'
' %s') % search_opts['changes'
'_since'])
raise exceptions.CommandError(
_('Invalid changes-since value: %s') %
search_opts['changes-since']
)
if parsed_args.long:
columns = (

View File

@ -1584,7 +1584,7 @@ class TestServerList(TestServer):
'all_tenants': False,
'user_id': None,
'deleted': False,
'changes_since': None,
'changes-since': None,
}
# 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)
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.servers_mock.list.assert_called_with(**self.kwargs)

View 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>`_]