diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index 034199822..3b805639e 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -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 = ( diff --git a/openstackclient/tests/unit/compute/v2/test_server.py b/openstackclient/tests/unit/compute/v2/test_server.py index ad52e2322..99cdfb777 100644 --- a/openstackclient/tests/unit/compute/v2/test_server.py +++ b/openstackclient/tests/unit/compute/v2/test_server.py @@ -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) diff --git a/releasenotes/notes/bug-1732216-b41bfedebff911e1.yaml b/releasenotes/notes/bug-1732216-b41bfedebff911e1.yaml new file mode 100644 index 000000000..d792f25a2 --- /dev/null +++ b/releasenotes/notes/bug-1732216-b41bfedebff911e1.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix the operation of the ``--changes-since`` option to the ``server list`` command. + [Bug `1732216 `_]